kblib 0.2.3
General utilities library for modern C++
containers.h File Reference

Provides generic operations for containers, as well as kblib::stack. More...

#include "fakestd.h"
#include "iterators.h"
#include "tdecl.h"
#include "traits.h"
#include <cstddef>
#include <deque>
#include <iterator>
#include <memory>
#include <stack>
#include <type_traits>
#include <vector>
Include dependency graph for containers.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  kblib::exists_t< iterator >
 
struct  kblib::construct_with_size< C, size >
 
struct  kblib::construct_with_capacity< C, size >
 
class  kblib::build_iterator< Container, ArrayLike >
 
struct  kblib::build_end_t
 
class  kblib::build_iterator< Container, true >
 
struct  std::tuple_size<::kblib::construct_with_size< C, Size > >
 
struct  kblib::detail::buildiota_impl< construct_with_size< Container, N >, false >
 
class  kblib::stack< T, Container >
 

Namespaces

namespace  kblib
 The main namespace in which all entities from kblib are defined.
 
namespace  std
 
namespace  kblib::detail
 The namespace used for implementation details within kblib.
 

Functions

template<typename C >
constexpr auto kblib::pop (C &s) -> typename C::value_type
 
template<class C , typename K , typename V >
constexpr auto kblib::get_or (const C &m, const K &key, const V &defval) -> typename C::mapped_type
 
template<typename Map , typename Key >
constexpr auto kblib::try_get (Map &map, Key &&key) -> copy_const_t< Map, typename Map::mapped_type > *
 
template<typename M , typename K >
constexpr auto kblib::get_check (M &&m, const K &key) noexcept(noexcept(m.find(key) !=m.end())) -> exists_t< decltype(m.find(key))>
 
template<typename V >
auto kblib::force_shrink_to_fit (V &vec) -> void
 std::vector::shrink_to_fit is non-binding, which means that there is no guaranteed way to shrink a vector via its API. This function is a roundabout way of doing that without relying on the sanity of the implementation (except that it assumes that a vector won't significantly over-allocate on sized construction). More...
 
template<typename Container , typename Range >
constexpr auto kblib::construct_from_range (Range &&r) -> Container
 Allows for constructing a container of a specified type from a range object. Copy elision means that this does not result in any extra copies. More...
 

Variables

constexpr struct kblib::build_end_t kblib::build_end
 

Detailed Description

Provides generic operations for containers, as well as kblib::stack.

Author
killerbee
Date
2019-2021

Definition in file containers.h.