Reputation: 2962
I looked a bit into Eric Nieblers range library https://github.com/ericniebler/range-v3/ and there (/include/range/v3/utility/concepts.hpp, line 36) I found code of the form
constexpr struct valid_expr_t
{
template<typename ...T>
true_ operator()(T &&...) const;
} valid_expr {};
I am confused to the second scope/braces after valid_expr. What is the meaning of the whole construct. Is this even a struct definition? The syntax seems not allowed in C++98. What can go into these second pair of braces?
Upvotes: 1
Views: 43
Reputation: 409176
It's the C++11 uniform initialization syntax, and it simply initializes the valid_expr
object.
It's like doing
struct valid_expr_t
{
template<typename ...T>
true_ operator()(T &&...) const;
};
constexpr valid_expr_t valid_expr {};
Upvotes: 4