标签:iterator eal mpi uid lang require for isa line
Get your own compiler:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-4.9
you can then compile using the command:
g++-4.9 -std=c++14 -Wall -Werror -O2 -o helloworld helloworld.cpp
Style Rules:
Macros should never be required in C++.
Variables should be defined close to their use.
Don’t use malloc/realloc, use new (or smart pointers)
Minimise use of void*, pointer arithmetic, union and c-style casts
Minimise the use of C-style arrays and strings, use vector/array (from C++11) and string instead.
总之,忘掉C语言。
C++ Standard Library
For efficiency reasons, STL is not object-oriented:
The Standard Template Library (STL) is a part of the C++ standard library, Some others are:
分类一:
分类二:
Containers: vector, list, stack, ...
Algorithms: find, sort, copy, ...
Iterators are the glue between the two!
The compilation process:
1. Preprocessing - handles meta-information (e.g., #include)
2. Compiling - translates C++ into machine code objects
3. Linking - merges objects into a single application
对语言风格的实践就是最好的学习路径。明白了作者的风格定义思路,也就意味着语言学习达到了优良水准。
路漫漫其修远兮…… 除了坚持,没有捷径。Good luck!
[c++] Basic ideas and Style Guide
标签:iterator eal mpi uid lang require for isa line
原文地址:http://www.cnblogs.com/jesse123/p/6082879.html