diff --git a/README.md b/README.md index a6c045f1..008035df 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# Obscure Efficient Library +# OE-Lib -A cross-platform, very fast substitute for C++ std::vector (and std::copy) with a range-based interface. +A cross-platform, very fast substitute for C++ std::vector with a range-based interface, and a bunch of supporting utilities. -Features relocation optimizations similar to [Folly fbvector](https://github.com/facebook/folly/blob/master/folly/docs/FBVector.md#object-relocation) and UnrealEngine TArray. +Features relocation optimizations similar to [Folly fbvector](https://github.com/facebook/folly/blob/master/folly/docs/FBVector.md#object-relocation) and UnrealEngine TArray. Also uses `realloc` when possible, which showed substantial performance improvements when tested on a Linux system. The library is distributed under the Boost Software License, and is header only, just include and go. diff --git a/dynarray.h b/dynarray.h index 36b03f41..1378f1af 100644 --- a/dynarray.h +++ b/dynarray.h @@ -21,14 +21,6 @@ namespace oel { -struct _toDynarrayFn -{ - template< typename Alloc = allocator<> > - constexpr auto operator()(Alloc a = {}) const - { - return _detail::ToDynarrPartial{std::move(a)}; - } -}; //! `r | to_dynarray()` is equivalent to `r | std::ranges::to()` /** * Example, convert array of std::bitset to `dynarray`: @@ -36,7 +28,11 @@ struct _toDynarrayFn std::bitset<8> arr[] {3, 5, 7, 11}; auto result = arr | view::transform(OEL_MEMBER_FN(to_string)) | to_dynarray(); @endcode */ -inline constexpr _toDynarrayFn to_dynarray; +template< typename Alloc = allocator<> > +constexpr auto to_dynarray(Alloc a = {}) + { + return _detail::ToDynarrPartial{std::move(a)}; + } //! Overloads generic unordered_erase(RandomAccessContainer &, Integral) (in range_algo.h) template< typename T, typename A > inline