4

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4553.pdf

gcc6: -fconcepts

template<typename T>
concept bool String = requires(T s)
{
    { s.clear() } -> void;
    // etc.
};

void print(const String& message);
//void print(Str message); // I want Str = const String&

void test()
{
  std::string str;
  print(str);
}

Strとして宣言する方法はありますconst String&か?

4

1 に答える 1