Search Results
8/2/2025, 3:58:46 PM
>>106108612
rate my code, how to improve this ?
export class VertexShader
{
std::string source;
public:
operator std::string() const { return source; }
operator std::string_view() const { return source; }
explicit VertexShader() = default;
explicit VertexShader(const std::string& src) : source(src) {}
explicit VertexShader(std::string&& src) : source(std::move(src)) {}
};
export class FragmentShader
{
std::string source;
public:
operator std::string() const { return source; }
operator std::string_view() const { return source; }
explicit FragmentShader() = default;
explicit FragmentShader(const std::string& src) : source(src) {}
explicit FragmentShader(std::string&& src) : source(std::move(src)) {}
};
rate my code, how to improve this ?
export class VertexShader
{
std::string source;
public:
operator std::string() const { return source; }
operator std::string_view() const { return source; }
explicit VertexShader() = default;
explicit VertexShader(const std::string& src) : source(src) {}
explicit VertexShader(std::string&& src) : source(std::move(src)) {}
};
export class FragmentShader
{
std::string source;
public:
operator std::string() const { return source; }
operator std::string_view() const { return source; }
explicit FragmentShader() = default;
explicit FragmentShader(const std::string& src) : source(src) {}
explicit FragmentShader(std::string&& src) : source(std::move(src)) {}
};
Page 1