Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++11 Features? #5

Open
lojack5 opened this issue Apr 28, 2014 · 2 comments
Open

C++11 Features? #5

lojack5 opened this issue Apr 28, 2014 · 2 comments
Labels

Comments

@lojack5
Copy link
Owner

lojack5 commented Apr 28, 2014

I've been working on refactoring a bit of the CBash code to reduce code duplication and make it less error prone (in the writing end of it). Specifically, I'm looking at addressing the classes used to define records, SubRecord, SimpleSubRecord, etc. I've come across a few things I would like to use that are from the C++11 standard though:

  1. Fixes the parsing of closing template brackets so you don't have to put spaces. I.E: Outer<Inner<int>> vs Outer<Inner<int> >. This one is't needed, it's just bugged me for ages that the first wasn't possible.

  2. Ranged For-Loops:

    int sum = 0;
    for( const int &i: vect)
        sum += i;

    vs

    int sum = 0;
    for(auto it = vect.begin(); i != vect.end(); ++i)
        sum += *it;

    Again, not needed for the refactoring I'm doing at the moment, but would be nice to use, especially in the future.

  3. Constructor delegations. Nuff said I think. Makes it easier to ensure objects are in a good state when exceptions happen in a constructor.

  4. Move-Constructor / Move-Assignement - makes memory management much easier

As far as building with Visual Studio, this would require 2013 (Express or otherwise).

@wrinklyninja, @Gruftikus : would using C++11 features cause any problems for you guys?

@Ortham
Copy link

Ortham commented Apr 28, 2014

Nope, I use MSVC 2013 anyway, and the constructor delegation alone sounds like a good enough reason for CBash to use C++11.

@Gruftikus
Copy link

I have not yet tried to compile CBash, and in fact I can wait for all changes, because I still have so many things on my list. I have VC++2010, but I think I can make an upgrade for free.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants