On 2 Jan 2018 16:30:44 GMT
r...@zedat.fu-berlin.de (Stefan Ram) wrote:
>
malcolm.ar...@gmail.com writes:
> >Can anyone suggest a good course / resource for someone who
> >used C++ a lot about ten years ago, and now wants to pick it
> >back up, the "look and feel" of the language having changed
> >substantially in the intervening period due to greater use of
> >templates for generic programming
>
> Today, we sometimes can /replace/ the use of templates by
> more readable constexpr functions.
And for type computation (as opposed to constexpr value computation),
you can sometimes replace C++98-style templated structs containing
typedefs by decltype with the C++14 auto return type used with
(non-constexpr) template functions. When you call decltype on a
function application the function is not executed: only its return type
is deduced.
You can use decltype with function templates in C++14 to iterate over
and manipulate type lists at compile time, for example.
Excluding signature overloading, there are I suppose four kinds of
compile-time computation available to the user now in C++14: sizeof,
decltype, constexpr and templates. Of these, C++98 had only sizeof and
templates. Possibly there are more: I would need to think about that.