From 1256ec201cdb3a8d3d9bb4ebe9c25637a718465e Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Fri, 22 Mar 2024 19:32:59 -0400 Subject: [PATCH] any_t const --- CMakeLists.txt | 2 +- include/blt/std/any.h | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fd8c05f..41c8a67 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.5) 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_TARGET BLT) diff --git a/include/blt/std/any.h b/include/blt/std/any.h index 851ce03..7ec4c83 100644 --- a/include/blt/std/any.h +++ b/include/blt/std/any.h @@ -168,15 +168,14 @@ namespace blt::unsafe {} template - buffer_any_t& set(const T& t) + void set(const T& t) const { static_assert(std::is_trivially_copyable_v && "Type must be trivially copyable"); std::memcpy(_data, &t, sizeof(t)); - return *this; } template - T any_cast() + T any_cast() const { static_assert(std::is_trivially_copyable_v && "Type must be trivially copyable"); T t;