Closed
Description
Compiling the following Cpp2 code
MyStruct: @struct <T> type = {}
produces a non-templated class
.
class MyStruct
{
};
Explicitly stating that T
is a type
parameter resolves this issue, but I wonder if this is the intended behavior.
MyStruct: @struct <T: type> type = {}
compiles to
template <typename T> class MyStruct
{
};
This behavior is in contrast to custom types without the @struct
metafunction.
MyClass: <T> type = {}
compiles to
template <typename T> class MyClass
{
public:
MyClass() = default;
public:
MyClass(MyClass const&) = delete; /* No 'that' constructor, suppress copy */
public:
auto operator=(MyClass const&) -> void = delete;
};