Код: Выделить всё
enum class PushConstantType { vec1, vec2, vec4 };
template
struct PushConstant
{
PushConstant& operator=(const T& value)
{
Value = static_cast(value);
return *this;
}
T Value {};
};
Код: Выделить всё
struct PushConstant_Vec1 : public PushConstant {};
Код: Выделить всё
PushConstant_Vec1::PushConstant_Vec1': no overloaded function could convert all the argument types
PushConstant_Vec1::PushConstant_Vec1(const PushConstant_Vec1 &)': cannot convert argument 1 from 'float' to 'const PushConstant_Vec1 &'
Conversion requires a second user-defined-conversion operator or constructor
Можно ли это сделать, определяя шаблонный оператор присваивания в базовом классе?>
Подробнее здесь: https://stackoverflow.com/questions/799 ... base-class
Мобильная версия