any_t const
parent
2dd44ca6e7
commit
1256ec201c
|
@ -1,7 +1,7 @@
|
||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.5)
|
||||||
include(cmake/color.cmake)
|
include(cmake/color.cmake)
|
||||||
|
|
||||||
set(BLT_VERSION 0.15.3)
|
set(BLT_VERSION 0.15.4)
|
||||||
set(BLT_TEST_VERSION 0.0.1)
|
set(BLT_TEST_VERSION 0.0.1)
|
||||||
|
|
||||||
set(BLT_TARGET BLT)
|
set(BLT_TARGET BLT)
|
||||||
|
|
|
@ -168,15 +168,14 @@ namespace blt::unsafe
|
||||||
{}
|
{}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
buffer_any_t& set(const T& t)
|
void set(const T& t) const
|
||||||
{
|
{
|
||||||
static_assert(std::is_trivially_copyable_v<T> && "Type must be trivially copyable");
|
static_assert(std::is_trivially_copyable_v<T> && "Type must be trivially copyable");
|
||||||
std::memcpy(_data, &t, sizeof(t));
|
std::memcpy(_data, &t, sizeof(t));
|
||||||
return *this;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T any_cast()
|
T any_cast() const
|
||||||
{
|
{
|
||||||
static_assert(std::is_trivially_copyable_v<T> && "Type must be trivially copyable");
|
static_assert(std::is_trivially_copyable_v<T> && "Type must be trivially copyable");
|
||||||
T t;
|
T t;
|
||||||
|
|
Loading…
Reference in New Issue