Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualKhatharr

Posted 04 December 2012 - 01:54 AM

Yeah, wasn't paying attention to the body when I did that. (derp) The var should have an initial value, but I just figure if you're gonna use a for loop that breaks when a var is at a specific value then why not use the for-loop syntax?

Here's an upgraded version:
[source lang="cpp"]void operator,() { for(int result = initial_val; result != x; ) { //do stuff result = whatever; }}[/source]

Posted Image

Anyway, I'll use 'while(true)' sometimes, although MSVC has an annoying warning about it. Suppose it's a matter of preference.

#6Khatharr

Posted 04 December 2012 - 01:54 AM

Yeah, wasn't paying attention to the body when I did that. (derp) The var should have an initial value, but I just figure if you're gonna use a for loop that breaks when a var is at a specific value then why not use the for-loop syntax?

Here's an upgraded version:
[source lang="cpp"]void operator,() { for(int result = initial_val; result != x; ) { //do stuff result = whatever; }}[/source]

Posted Image

Anyway, I'll use 'while(true)' sometimes, although MSVC has an annoying warning about it.

#5Khatharr

Posted 04 December 2012 - 01:52 AM

Yeah, wasn't paying attention to the body when I did that. (derp) The var should have an initial value, but I just figure if you're gonna use a for loop that breaks when a var is at a specific value then why not use the for-loop syntax?

Here's an upgraded version:
[source lang="cpp"]void operator,() { for(int result = initial_val; result != x; ) { //do stuff result = whatever; }}[/source]

#4Khatharr

Posted 04 December 2012 - 01:50 AM

Yeah, wasn't paying attention to the body when I did that. (derp) The var should have an initial value, but I just figure if you're gonna use a for loop that breaks when a var is at a specific value then why not use the for-loop syntax?

Here's an upgraded version:
[source lang="cpp"]void operator,(auto anything = 0) { for(int result = initial_val; result != x; ) { //do stuff result = whatever; }}[/source]

#3Khatharr

Posted 04 December 2012 - 01:49 AM

Yeah, wasn't paying attention to the body when I did that. (derp) The var should have an initial value, but I just figure if you're gonna use a for loop that breaks when a var is at a specific value then why not use the for-loop syntax?

Here's an upgraded version:
[source lang="cpp"]void operator,(void* anything) { for(int result = initial_val; result != x; ) { //do stuff result = whatever; }}[/source]

#2Khatharr

Posted 04 December 2012 - 01:48 AM

Yeah, wasn't paying attention to the body when I did that. (derp) The var should have an initial value, but I just figure if you're gonna use a for loop that breaks when a var is at a specific value then why not use the for-loop syntax?

Here's an upgraded version:
[source lang="cpp"]void operator,() { for(int result = initial_val; result != x; ) { //do stuff result = whatever; }}[/source]

PARTNERS