Code Monkey home page Code Monkey logo

cpp17_in_tts's Introduction

cpp17_in_TTs

Descriptions of C++17 features, presented mostly in "Tony Tables" (hey, the tables were my idea, but name wasn't).

There are actually over 100 changes in C++17, only some of them are listed here.

See the list of files in the repo - typically one file per feature (hopefully obvious via the file name). Or look at them all at once in ALL_IN_ONE.md (which is regenerated semi-regularly)

Some sources and/or places for good C++17 info:

https://jfbastien.github.io/what-is-cpp17/#/
http://www.bfilipek.com/2017/01/cpp17features.html https://github.com/AnthonyCalandra/modern-cpp-features http://en.cppreference.com
http://stackoverflow.com Bryce Adelstein Lelbach's talk to be seen at C++Now 2017 https://skebanga.github.io/structured-bindings/ (structured bindings) https://github.com/accuBayArea/Slides/blob/master/slides/2017-04-19.pdf (polymorphic memory resources)

-Caveat: This was made by humans. It likely contains errors.

Created with the support from my employer, Christie Digital Systems, Inc.

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

cpp17_in_tts's People

Contributors

antonbikineev avatar brycelelbach avatar daniel-beard avatar goldsborough avatar k-4-b-4 avatar kalman5 avatar mrotschi avatar offa avatar philmiller avatar sehe avatar shuber2 avatar tvaneerd avatar vtronko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cpp17_in_tts's Issues

structure binding typo

template< int N > struct tuple_element<N,foo>...

Should be

template<size_t N> struct tuple_element<N,foo>...

Byte type

I've never used a type with "byte" in its name except the one for Win32 APIs: BYTE. However, I have used char, uint8_t, etc., to mean a byte type. Having a byte_t would be better as it would be semantically correct and would be portable to any remaining platforms with non-8-bit bytes.

Please consider adding a license

I'd like to use part of the content here in my presentation (with proper credit, of course). There is no explicit license currently mentioned in the repo and the mentioning of your employer makes me worry even more about the possible copyright issues...
It'd be great if you could please consider adding a license (or at least clarify it in README).

Add a bit about monostate in std::variant section?

Thank you for the link to the ALL_IN_ONE.md and the work behind it. What a great read, I wish I knew it existed before!

By usage, I found one thing that's hard/awkward with std::variant is when your types aren't defaulted constructible (or when you want an option for the case where it's not initialized (optional)), with the use of std::monostate. Perhaps adding a small bit about this would be good?

I realize this isn't meant to replace actual documentation but rather get to the point (and it's doing an awesome job at it!), so perhaps that would be considered clutter, I'm not sure.

Structured Bindings auto without ref

Based on your source Structured Bindings :
auto [ a, b ] = stuff()
a and b variables is going to be value types instead of references.

correct compiled code is :
auto __tmp = stuff(); auto i = get<0>(__tmp); auto s = get<1>(__tmp);

adding reference example could clean up the idea behind Structured Bindings and why we needed the new syntax. ie: reference can not be obtained with std::tie.

Mistake in first table in structured_bindings.md?

Hi
I'm not sure if you didn't mean C++11 in the first column of the table. Well, it's right to put C++14, as it should be valid C++14, but I was just wondering.
I hope I'm not wasting your time with this. I'm just learning :)
Thanks,
Juraj

Constexpr If

C++14 code in examples in Constexpr If is not valid code. For instance the return type should be at least const auto&.
Also the claim about the usage of get<>() for user defined type is not complete. The specialization of std::tuple_size and std::tuple_element has to be provided.

Parallel execution policies

The parallel execution policies are live in the std::execution namespace not plain std, unless something changed that I missed.

`std::any` requires no calls to new?

The Tony Table for std::any says that any it does not require calls to new.

I think that's a bit misleading. The object still needs to be stored somewhere, and the only way to avoid storing it on the heap is to use a small-object optimization, which only applies to objects that are sufficiently small (in the libcxx implementation, 3 words in size or smaller).

std::optional usage example with new if is iffy

// nicer with new if syntax:
if (optional ofoo = parseFoo(str); ofoo)
   use(*ofoo);

Even nicer, old style, without the extraneous ofoo conditional?

if (optional ofoo = parseFoo(str))
   use(*ofoo);

Old style if could always be a single declaration,
new style needed for more complex cases.

We could argue the ifs and buts.

Indenting in C++ examples is confused.

The indenting in your examples is confused, whether I view it from my github account or anonymously.

My theory is that you are mixing tabs and spaces, and your tab stops are different from GitHub's default tab stops. :-)

The screen shot shows one example, but a similar problem appears on nearly all of them.

screen shot 2017-03-27 at 18 41 32

Thanks for this great resource!

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.