c++11 and VS2010 options

Started by
4 comments, last by bubbaray97 11 years, 1 month ago

I'm looking for an option (easy option) to use c++11 range-for loops in VS2010.

On my primary machine I have Windows 7 and VS2012 (which I upgraded to specifically to get more of the C++11 features). But my "real job" has me traveling quite a bit lately and at the momment I'm in a hotel in London (I live in the states). While my work laptop has 7 on it, I can't really install VS on it to do a non-work project. I had an old laptop I brought along thinking I could keep working on my project, but unfortunatly it has WinXP and can't get VS2012 installed on it.

So I'm back to VS2010, but it doesn't support everything thats already in my code. Google has sadly failed me in looking for a way to get range-for support into 2010, so I hoping someone has a suggestion. I'd really like to be able to keep working on my project while I'm in the hotel, but I certainly don't want to go through all my existing code to replace all my loops...(espcially since when I get home I'd want to switch them back...)

Thanks

B

Advertisement

Do you use MS-specific extensions? If no, you may try MinGW, which has pretty good support for C++11, along with, e.g., Qt Creator, or Eclipse.

If you're using the VS2010 C++ compiler, then there are very few options beyond what you already know.
One possible option worth considering is to use something like WinMerge and maintain a VS2010 codebase and a VS2012 codebase. Rather than copying back and forth each time, you merge between each time. Obviously this will become unsuitable as the project reaches a certain size. It's far from ideal, but I've been there as a temporary solution.
Other than that, you're stuck with doing what many of us do, and that's to write code for the lowest common denominator, which means saying goodbye to those C++11 features... for now.
If that's really unpalatable to you - get a new laptop.
"In order to understand recursion, you must first understand recursion."
My website dedicated to sorting algorithms

I'm not sure what your asking for exactly but there is the for_each algorithm you can use.

for_each (myvector.begin(), myvector.end(), myfunction);

http://www.cplusplus.com/reference/algorithm/for_each/

If this post or signature was helpful and/or constructive please give rep.

// C++ Video tutorials

http://www.youtube.com/watch?v=Wo60USYV9Ik

// Easy to learn 2D Game Library c++

SFML2.2 Download http://www.sfml-dev.org/download.php

SFML2.2 Tutorials http://www.sfml-dev.org/tutorials/2.2/

// Excellent 2d physics library Box2D

http://box2d.org/about/

// SFML 2 book

http://www.amazon.com/gp/product/1849696845/ref=as_li_ss_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=1849696845&linkCode=as2&tag=gamer2creator-20

- Many workplaces would not mind someone installing an official, free-of-charge programming tool straight from Microsoft to learn a potentially valuable business skill on their free time. Why not mail your IT guys and simply ask if they are cool with that?

- Switch to a different compiler like MinGW that does support those features on your old laptop.

- Install Win7 on your old laptop to get VS2012 on it.

Thank you all for the suggestions. I really do appreciate it.

A few responses...

@iMalc and @Stroppy Katamari....yes new laptop/getting Win7 on this laptop will be the plan most likely...doesn't help for this trip though...of course since its a little after midnight tonight and just wrapped up today's meetings that may not matter anyway...

@Stroppy and @ppodsiadly...I will checkout MinGW in general though...as I'm not using anything MS specific (at least not on purpose)

@eddie....yeah I was aware of that, but really didn't want to change all my code. I considered using that as a macro in replace for what I wanted, but that just seemed ugly.

And lastly....@Stroppy....technically I have admin rights on my work laptop so I *could* install it without having to talk to IT, but considering I left development over 10 years ago as a profession it would be a challenge to explain to the company why that would be of value to them....but far more importantly...per my employee aggreement (which granted it easily challenged in court) anything done on company property becomes IP of the company and I'd rather not give them my game for free :)

So it seems like I'm left with...

1) Change IDE

2) Change my code (either LCD, or using function like eddie suggested)

3) Upgrade my "travel" system

Kinda what I thought (although to be honest I really hadn't considered the IDE swithc before, not sure why)....but thought it was worth the chcek.

Thank you all....

This topic is closed to new replies.

Advertisement