Skip to content

Commit

Permalink
to_dynarray no longer a niebloid, and minor README update
Browse files Browse the repository at this point in the history
  • Loading branch information
OleErikPeistorpet committed Jun 9, 2024
1 parent c803134 commit 7cb384b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
14 changes: 5 additions & 9 deletions dynarray.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,18 @@
namespace oel
{

struct _toDynarrayFn
{
template< typename Alloc = allocator<> >
constexpr auto operator()(Alloc a = {}) const
{
return _detail::ToDynarrPartial<Alloc>{std::move(a)};
}
};
//! `r | to_dynarray()` is equivalent to `r | std::ranges::to<dynarray>()`
/**
* Example, convert array of std::bitset to `dynarray<std::string>`:
@code
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<Alloc>{std::move(a)};
}

//! Overloads generic unordered_erase(RandomAccessContainer &, Integral) (in range_algo.h)
template< typename T, typename A > inline
Expand Down

0 comments on commit 7cb384b

Please sign in to comment.