new trait volatile flags

This commit is contained in:
BlackMATov
2024-02-03 21:32:27 +07:00
parent 65324af30b
commit 41bba15c1b
4 changed files with 18 additions and 2 deletions

View File

@@ -5,6 +5,7 @@
- type conversions
- fix all includes to work with the library more flexible
- test and support shared libraries
- add volatile support for uarg/variable
## Version 1.0

View File

@@ -12,6 +12,7 @@ namespace meta_hpp::detail
{
enum class member_flags : std::uint32_t {
is_readonly = 1 << 0,
is_volatile = 1 << 1,
};
using member_bitflags = bitflags<member_flags>;
@@ -35,6 +36,10 @@ namespace meta_hpp::detail
flags.set(member_flags::is_readonly);
}
if constexpr ( std::is_volatile_v<value_type> ) {
flags.set(member_flags::is_volatile);
}
return flags;
}
};

View File

@@ -12,6 +12,7 @@ namespace meta_hpp::detail
{
enum class pointer_flags : std::uint32_t {
is_readonly = 1 << 0,
is_volatile = 1 << 1,
};
using pointer_bitflags = bitflags<pointer_flags>;
@@ -31,6 +32,10 @@ namespace meta_hpp::detail
flags.set(pointer_flags::is_readonly);
}
if constexpr ( std::is_volatile_v<data_type> ) {
flags.set(pointer_flags::is_volatile);
}
return flags;
}
};

View File

@@ -12,8 +12,9 @@ namespace meta_hpp::detail
{
enum class reference_flags : std::uint32_t {
is_readonly = 1 << 0,
is_lvalue = 1 << 1,
is_rvalue = 1 << 2,
is_volatile = 1 << 1,
is_lvalue = 1 << 2,
is_rvalue = 1 << 3,
};
using reference_bitflags = bitflags<reference_flags>;
@@ -33,6 +34,10 @@ namespace meta_hpp::detail
flags.set(reference_flags::is_readonly);
}
if constexpr ( std::is_volatile_v<data_type> ) {
flags.set(reference_flags::is_volatile);
}
if constexpr ( std::is_lvalue_reference_v<Reference> ) {
flags.set(reference_flags::is_lvalue);
}