Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Official C++ language subsets

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.

like image 664
Victor Liu Avatar asked Jun 18 '10 23:06

Victor Liu


People also ask

Which language is a subset of C language?

The programming language Java was introduced in 1994 as a simplified subset of C for deployment over the Internet and for use in portable devices with limited memory or limited processing capabilities.

How many types of C languages are there?

There are four basic data types in C programming, namely Char, Int, Float, and Double.

What are language subsets?

[′laŋ·gwij ′səb‚set] (computer science) A portion of a programming language that can be used alone; usually applied to small computers that do not have the capability of handling the complete language.


1 Answers

Google publishes its internal C++ style guide, which is often referred to as such a subset: https://google.github.io/styleguide/cppguide.html . Ben Maurer, whose company reCAPTCHA was acquired by Google, describes it as follows in this post on Quora:

You can basically think of Google's C++ subset as C plus a bit of sugar:

The ability to add methods to structs

Basic single inheritance.

Collection and string classes

Scope based resource management.

They also publish a lint tool, cpplint.py.

like image 69
unmounted Avatar answered Oct 08 '22 08:10

unmounted