Code: Select all
template
concept CanFoo = requires(Eigen::Array2d const& x) {
{ T::Foo(x) } -> std::same_as;
};
Code: Select all
template
requires CanFoo
class Host_t {
T_Bar bar_;
};
zu instanziieren
Code: Select all
class RedActor {
public:
static double Foo(Eigen::Array3d const& x) { return x.mean(); }
};
// Example application
TEST(YYY, XXX) {
Host_t blah;
}
Das ist jedoch nicht der Fall ... als jemand, der neu in Template-Konzepten ist, widerspricht dies meiner am wenigsten überraschenden Erwartung. Warum wird das kompiliert?
Mobile version