GithubHelp home page GithubHelp logo

johnvenn / cpp_features Goto Github PK

View Code? Open in Web Editor NEW

This project forked from blep/cpp_features

0.0 0.0 0.0 34 KB

Demo of new C++ features (C++ 03, 11, 14)

License: MIT License

CMake 13.35% C++ 86.65%

cpp_features's Introduction

cpp_features

Demo of new C++ features (C++ 03, 11, 14) accross compiler.

Use CMake ctest to test for successful execution or expected compilation failure.

Good summary of C++17 features: https://stackoverflow.com/questions/38060436/what-are-the-new-features-in-c17

Test to do:

  • final with inheritance
  • func not in param decl
  • Template argument deduction for class templates
  • template <= infer any non type arg
  • Folding expression: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4295.html
  • constexpr lambda
  • structured binding: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0217r3.html; auto [x,y] = tuple or array
  • if (init; condition) and switch (init; condition)
  • Direct list-initialization of enums => custom int type enum class MyInt {}; MyInt value{5}; // < implicit conversion allowed.
  • variant
  • optional
  • string_view
  • invoke
  • apply
  • make_from_tuple
  • is_invokable
  • std::clamp // <= is generated code as good as non-branching code used in game?

Stuffs to investigate: inheriting_constructors.cpp:

  • when debugging, step into on SubDefault variable construction does not step into Base constructor
  • putting a break-point in Base constructor force compiler to break though.

Idea to explore: Can you use UDL to generate compile time string formatting ? "Hello %s!"fmt( "World" ); => no reasonnable until C++ 17 as currently constexpr must be recursive. => additional constexpr is not evaluated only once on all compilers

Experimental C++ 17 stuffs: https://www.visualstudio.com/en-us/news/vs2015-vs.aspx#C++

  • Resumable Functions (resume/await) The resume and await keywords provide language-level support for asynchronous programming and enables resumable functions. Currently, this feature is only available for x64 targets. Proposed for C++17 [N3858]

VS 2015 standard conformance (nearly all c++14 an a lot c++17): http://blogs.msdn.com/b/vcblog/archive/2015/06/19/c-11-14-17-features-in-vs-2015-rtm.aspx

cpp_features's People

Contributors

blep 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.