Git Product home page Git Product logo

cppfeatures's Introduction

C++ 新特性

一、 Variadic Templates(数量不定的模板参数)
  • ... 接受多个参数, 表示一组/包东西(pack)
    • 用于template parameter => template parameter pack
    • 用于function parameter types => function parameter type pack
    • 用于function parameters => function parameter pack
  • Inside variadic templates , sizeof...(args) yields the number of arguments
  • 作用
    • 递归
    • 继承
二、Spaces in template Expression
   vector<list<int> > // Ok in each C++ version
   vector<list<int>> //Ok since C++11
三、nullptr and std::nullptr_t
  • nullptr 空指针 = 0/NULL
void f(int);
void f(void*);

f(0); //call f(int)
f(NULL); //calls f(int) if NULL is 0
f(nullptr); //calls f(void*)
四、Automatic Type Deduction with auto

Using auto is especially useful where the type is pretty long and/or complicated expression.

cppfeatures's People

Contributors

dclcs avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.