From baa5952666594ce0d07a2b013e46c4bc343ba164 Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Tue, 21 Jan 2025 21:10:10 -0500 Subject: [PATCH] decltype(auto) on the select method --- CMakeLists.txt | 2 +- include/blt/std/random.h | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cb338b3..d41de9e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.20) include(cmake/color.cmake) -set(BLT_VERSION 3.0.5) +set(BLT_VERSION 3.0.6) set(BLT_TARGET BLT) diff --git a/include/blt/std/random.h b/include/blt/std/random.h index 9ffad57..1cfa8dc 100644 --- a/include/blt/std/random.h +++ b/include/blt/std/random.h @@ -191,13 +191,7 @@ namespace blt::random } template - constexpr auto& select(Container& container) - { - return container[get_u64(0, container.size())]; - } - - template - constexpr const auto& select(const Container& container) + constexpr decltype(auto) select(Container& container) { return container[get_u64(0, container.size())]; }