Skip to content

C++11 Features? #5

@lojack5

Description

@lojack5

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions