2
3
4
5
6
7
8
11#ifndef _GLSL_STRUCT_SCALAR_TYPE_HPP_
12 #define _GLSL_STRUCT_SCALAR_TYPE_HPP_
14 #include <glslstruct/config.hpp>
18 "This is only available for c++17 and greater and when types are not disabled with defined GLSL_STRUCT_DISABLE_TYPES!"
22 #include <glslstruct/type/containers/type.hpp>
26
27
28
29 class scalar_type :
public type<scalar_type> {
31 friend struct std::hash<scalar_type>;
33 using base_type = type;
40 explicit scalar_type(ValueType type, size_t size)
noexcept;
42 scalar_type(
const scalar_type& other)
noexcept;
44 scalar_type(scalar_type&& other)
noexcept;
46 ~scalar_type()
noexcept override;
49 scalar_type& operator=(
const scalar_type& other)
noexcept;
51 scalar_type& operator=(scalar_type&& other)
noexcept;
55 template<type_visitor T>
57 template<
class T, std::enable_if_t<is_type_visitor_v<T>,
bool> =
true>
59 void accept(T& visitor)
const {
64 [[nodiscard]] ValueType get_type()
const noexcept;
67 [[nodiscard]] std::string to_string()
const noexcept override;
69 friend bool operator==(
const scalar_type& lhs,
const scalar_type& rhs)
noexcept;
70 friend bool operator!=(
const scalar_type& lhs,
const scalar_type& rhs)
noexcept;
74
75
76
77 [[
nodiscard]]
bool operator==(
const scalar_type& lhs,
const scalar_type& rhs)
noexcept;
79
80
81
82 [[
nodiscard]]
bool operator!=(
const scalar_type& lhs,
const scalar_type& rhs)
noexcept;
86
87
88
91 [[nodiscard]] size_t operator()(
const glslstruct::scalar_type& value)
const noexcept;
#define _GLSL_STRUCT_HAS_CXX20
check if compiler has c++ version greater or equal to c++20 and if user enabled c++20 features using ...
Definition config.hpp:142
#define _GLSL_STRUCT_HAS_TYPES
check if user not disabled type containers using GLSL_STRUCT_DISABLE_TYPES
Definition config.hpp:162
Main namespace of glslstruct library.
Definition scalar_layout_traits.hpp:23