Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualAmeise

Posted 02 January 2013 - 10:49 AM

If i'm not mistaken, i believe it's actually because you don't use the vector.

Being in release mode you are not permitted to declare variables/methods without actually using them.

That's just... wrong. You're absolutely allowed to have variables and methods that you never use. The compiler is free to remove them (to some degree), but merely having them itself is not an error in any way.

In most languages, at least. In Go, for instance, declaring unused variables is an error. But for C++, you can of course declare placeholder variables which you aren't actually using yet, the compiler will simply ignore them (usually). At least with correct code, adding extra unused variables should not change the program's observable behaviour.

 

So long as their construction/destruction has no global side-effects.


#1Ameise

Posted 02 January 2013 - 10:48 AM

If i'm not mistaken, i believe it's actually because you don't use the vector.

Being in release mode you are not permitted to declare variables/methods without actually using them.

That's just... wrong. You're absolutely allowed to have variables and methods that you never use. The compiler is free to remove them (to some degree), but merely having them itself is not an error in any way.

In most languages, at least. In Go, for instance, declaring unused variables is an error. But for C++, you can of course declare placeholder variables which you aren't actually using yet, the compiler will simply ignore them (usually). At least with correct code, adding extra unused variables should not change the program's observable behaviour.


So long as their construction/destruction has no global side-effects.


PARTNERS