views:

163

answers:

4

I mainly use C++ to do scientific computing, and lately I've been restricting myself to a very C-like subset of C++ features; namely, no classes/inheritance except complex and STL, templates only used for find/replace kinds of substitutions, and a few other things I can't put in words off the top of my head. I am wondering if there are any official or well-documented subsets of the C++ language that I could look at for reference (as well as rationale) when I go about picking and choosing which features to use.

+1  A: 

There is Embedded C++. It sounds mostly similar to what you're looking for.

Carl Norum
Embedded C++ never caught on; once you've butchered the language that much, it has no advantages over C.
Mike Seymour
@Mike, some would argue it never did.
Carl Norum
A: 

Well, latest developments (TR1, C++0x) in C++ made it very much generic, allowing you to do imperative, OOP or even (limited) functional programming in C++. Libraries like Boost also enable you to do very power declarative template-based meta-programming.

I think Boost is the first thing to try out in C++. It's a comprehensive library, which also includes several modules that enable you to program in functional style (Boost.Functional) or making compile-time declarative meta-programming (Boost MPL).

deemoowoor
Subsets, not supersets.
Joey Adams
Well, it depends what you call a set -- if just STL, then Boost is a superset indeed. But my point was that Boost.Functional and Boost.MPL are subsets of C++ as a language.
deemoowoor
I originally meant subset as in a subset of the language features itself. Boost seems to require a very comprehensive set of C++ features.
Victor Liu
+1  A: 

The GCC developers are about to allow some C++ features. I'm not aware of any official guidelines, yet, but I am pretty sure that they will define some. Have a look at initial report on the mailing list.

Malte Clasen
A: 

Not long ago I listened to this SE-Radio podcast - Episode 152: MISRA with Johan Bezem, which introduces MISRA, standard guidelines for C and C++ to ensure better quality, try looking at it.

Gabriel Ščerbák