stl_util.h Source File
|
CPP API
|
stl_util.h
Go to the documentation of this file.
49 inline std::ostream& set_ostream_format(std::ostream& out, size_t width, size_t precision, char fill = ' ')
52 return out << std::setw(width) << std::fixed << std::setprecision(precision) << std::setfill(fill);
100 // TODO: Make this a thin wrapper for std::ranges::subrange, once we have the ranges library (min libc++ version 16)
std::reverse_iterator< iterator > reverse_iterator
Definition: stl_util.h:105
Range(Iterator begin, Sentinel end)
Directly construct a Range from two iterators.
Definition: stl_util.h:111
Range(std::pair< I, S > iterator_pair)
Construct a Range from an std::pair of iterators.
Definition: stl_util.h:125
typename std::iterator_traits< iterator >::reference reference
Definition: stl_util.h:108
reference front() const requires std Sentinel m_sentinel
Get a reference to the first element in the range.
Definition: stl_util.h:143
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition: stl_util.h:106
Sentinel end() const
Get an iterator at the end of the range, pointing to one element after the last in the range.
Definition: stl_util.h:137
Iterator begin() const
Get an iterator to the start of the range, pointing at the first element of the range.
Definition: stl_util.h:132
typename std::iterator_traits< iterator >::value_type value_type
Definition: stl_util.h:107
size_t string_length(const char *str)
length of a null terminated C string
Definition: stl_util.h:215
void path_join_rec(std::stringstream &, bool)
breaks the recursion of path_join_rec.
Definition: stl_util.h:232
int size(Comm comm)
Return the size of the given communicator.
Definition: miompi.cpp:75
A collection of classes to simplify handling of matrix shapes in meta programming.
Definition: models/abm/analyze_result.h:30
requires details::IsElementReference< M > RowMajorIterator< M, false > end(M &m)
create a non-const end iterator for the matrix m.
Definition: eigen_util.h:449
Range(std::pair< I, S > iterator_pair) -> Range< I, S >
Deduction guide to correctly deduce range type when constructed from a pair.
concept HasOstreamOperator
Concept to check if type T has an existing stream output operator "<<".
Definition: stl_util.h:208
std::unique_ptr< U > dynamic_unique_ptr_cast(std::unique_ptr< T > &&base_ptr)
converts a unique_ptr<T> to unique_ptr.
Definition: stl_util.h:285
std::conditional_t< std::is_const_v< T >, typename mio::Range< typename std::vector< std::remove_const_t< T > >::const_iterator >, typename mio::Range< typename std::vector< std::remove_const_t< T > >::iterator > > VectorRange
Defines generic Range type for IterPair of a vector.
Definition: stl_util.h:341
requires(!std::is_trivial_v< T >) void BinarySerializerObject
Definition: binary_serializer.h:333
std::ostream & set_ostream_format(std::ostream &out, size_t width, size_t precision, char fill=' ')
Adds manipulators for width, (fixed) precision and fill character to an ostream.
Definition: stl_util.h:49
constexpr std::array< T, size_t(T::Count)> enum_members()
Get an std::array that contains all members of an enum class.
Definition: stl_util.h:319
requires details::IsElementReference< M > RowMajorIterator< M, false > begin(M &m)
create a non-const iterator to first element of the matrix m.
Definition: eigen_util.h:421
std::string path_join(String &&base, Strings &&... app)
join one ore more strings with path separators.
Definition: stl_util.h:268
void insert_sorted_replace(std::vector< T > &vec, T const &item, Pred pred)
inserts element in a sorted vector, replacing items that are equal precondition: elements in the vect...
Definition: stl_util.h:66
bool contains(Iter b, Iter e, Pred p)
checks if there is an element in this range that matches a predicate
Definition: stl_util.h:301
Definition: io.h:94
Generated by