Error: function declaration without return type.
Tobias Pankrath via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed Jan 7 01:43:51 PST 2015
On Wednesday, 7 January 2015 at 08:58:35 UTC, Suliman wrote:
> thanks!
>
> Am I right understand that in next code scope(exit)
> stmt.close(); occur after this execution? And it will close
> connection so stmt in function become unavailable.
>
> this(parseConfig parseconfig)
> {
> [....]
>
> auto conn = ds.getConnection();
> scope(exit) conn.close();
>
> stmt = conn.createStatement();
>
> scope(exit) stmt.close(); //HERE
>
> } void InsertData()
> {
> auto rs = stmt.executeUpdate(sqlinsert); // stmt now unreachable
> }
scope(exit) executes at the exit of the inner most scope. Scopes
end at '}'. Which is the very next line in this case.
More information about the Digitalmars-d-learn
mailing list