GoingNative 32: Sneak Preview of C++17

Sign in to queue

The Discussion

  • User profile image
    Deactivated User

    Excited to expect modules being covered and eager to hear about concepts.

  • User profile image
    Tobias Bruell

    Very interesting. Will the "Generalized constant expression in template arguments" allow it to write a template meta-function that takes a string literal (which does not have external linkage) and returns a matching std::integer_sequence<char, ...>?

  • User profile image
    fenbf

    nice description of the features!

    I especially liked that on the next committee meeting "modules" proposal will be discussed and maybe we'll see it in C++17.

  • User profile image
    Gabriel Dos Reis

    @Tobias -- this generalization is independent of whether string literals will be allowed as template arguments. My own personal preference is for the language to support direction expression of ideas, instead of roundabouts; that helps us, programmers, write robust and maintainable codes.

    The relaxations that we just voted in C++17 still require that a non-type pointer constant is either null or designates an object, but not a subobject (so that rules out array subobjects).

    There are a couple of proposals in the work to allow string literals as non-type template arguments. I hope they will be merged and that a good solution will emerge soon. It is much needed :-)

  • User profile image
    Gabriel Dos Reis

    @fenbf -- Thanks for the feedback. We are working very hard and tirelessly to make progress on modules. It is a non-trivial problem, but it is one that has a big productivity impact for C++ programmers. The C++ committee and the C++ community are acutely aware of that; then there are always factors that we can't control. Stay tuned :-)

  • User profile image
    Gabriel Dos Reis

    @Vipul -- Yes, I am very excited about Concepts Lite too. Can't wait to see the corresponding PDTS voted out for community feedback. We've made great progress. You will surely see more from us on that once we have the PDTS (real soon.) Stay tuned :-)

  • User profile image
    elvis

    The most cooler thing of c++ will be modules. I hope to see that in the next standard 😃

  • User profile image
    Zack

    I was upset Gaby didn't mention await until literally the last 5 seconds. Wish he would've talked more about it!

  • User profile image
    gdr

    @Zack -- await deserves its own segment which, no doubt, you will see once SG1+EWG have ironed out the details, hopefully soon :)

  • User profile image
    Zack

    Can't wait!

  • User profile image
    Ville

    The interview seemed to suggest string_views are mutable, but that's not
    the case according to the Fundamentals TSv1 and TSv2 doesn't change that.

  • User profile image
    gdr

    @Ville -- A string_view is an object that provides a reference semantics onto a string object.  So, there are two kinds of mutable operations here: on the view object itself, and on the string refereed to by the view.

     As an object, a string_view object does support a limited set of mutable operations, i.e. remove_prefix() and remove_suffix(), which shrink the "view". 

    You are absolutely and positively correct that the current official versions of a string_view object does not support mutating operations on the refereed-to string object.  

    That being said, one of the requests we made and discussed at the last meeting was to make string_view consistent with the array_view proposal.  The request arose from practical usage and considerations.

    I hope that clarifies things; and I will make sure next editions capture the distinctions :)

  • User profile image
    Ville

    Thanks Gaby, that clarifies things. And yeah, I think it would be wise to make string_view and array_view consistent, and furthermore I think forcing string_view to be read-only when it comes to the underlying character buffer is draconian. I know how to make things const when I want them const, whereas I do not know how to make things non-const when they are const to begin with. :) That is, assuming SANE operations. ;)

  • User profile image
    Aluan

    Very informative. Its really nice to see the set of standard features available improving, and I'm excited for modules.

  • User profile image
    Juan

    It's great that even black people get tech jobs.

Add Your 2 Cents