It's probably just that the concept is bad, but I can't see why. And didn't find any example with constructor. Or maybe it has nothing to do with the constructor...
template < typename T >
concept bool C_Object() {
return requires {
T();
};
}
template < C_Object Object>
class DefaultManager {
// Content;
};
template < C_Object Derived >
class Component {
// Content
};
struct Test : public Component<Test> {
int data;
Test() = default;
};
int main() {
Test test;
return 0;
}
Give the error :
test2.cpp:21:36: error: template constraint failure
struct Test : public Component<Test> {
^
test2.cpp:21:36: note: constraints not satisfied
test2.cpp:2:14: note: within ‘template<class T> concept bool C_Object() [with T = Test]’
concept bool C_Object() {
^~~~~~~~
test2.cpp:2:14: note: the required expression ‘T()’ would be ill-formed
That sound like a : "Hey my code is broken, please fix it", sorry.
Anyway thanks
Have a great day