decltype(auto) on the select method

v2
Brett 2025-01-21 21:10:10 -05:00
parent 74c1010118
commit baa5952666
2 changed files with 2 additions and 8 deletions

View File

@ -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)

View File

@ -191,13 +191,7 @@ namespace blt::random
}
template<typename Container>
constexpr auto& select(Container& container)
{
return container[get_u64(0, container.size())];
}
template<typename Container>
constexpr const auto& select(const Container& container)
constexpr decltype(auto) select(Container& container)
{
return container[get_u64(0, container.size())];
}