Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
map_util.h File Reference
#include <utility>
#include "ortools/base/logging.h"

Go to the source code of this file.

Namespaces

namespace  gtl
 

Typedefs

template<typename M >
using gtl::MapUtilValueT = typename M::value_type
 
template<typename M >
using gtl::MapUtilKeyT = typename MapUtilValueT<M>::first_type
 
template<typename M >
using gtl::MapUtilMappedT = typename MapUtilValueT<M>::second_type
 

Functions

template<typename Collection , typename KeyType = MapUtilKeyT<Collection>>
const MapUtilMappedT< Collection > & gtl::FindWithDefault (const Collection &collection, const KeyType &key, const MapUtilMappedT< Collection > &value)
 
template<class Collection , typename KeyType = MapUtilKeyT<Collection>>
const MapUtilMappedT< Collection > & gtl::FindWithDefault (const Collection &collection, const KeyType &key)
 
template<class Collection >
const Collection::value_type::second_type * gtl::FindOrNull (const Collection &collection, const typename Collection::value_type::first_type &key)
 
template<class Collection >
Collection::value_type::second_type * gtl::FindOrNull (Collection &collection, const typename Collection::value_type::first_type &key)
 
template<class Collection >
const Collection::value_type::second_type gtl::FindPtrOrNull (const Collection &collection, const typename Collection::value_type::first_type &key)
 
template<class Collection , class Key , class Value >
bool gtl::InsertOrUpdate (Collection *const collection, const Key &key, const Value &value)
 
template<class Collection >
bool gtl::InsertIfNotPresent (Collection *const collection, const typename Collection::value_type &value)
 
template<class Collection , class Key , class Value >
bool gtl::InsertIfNotPresent (Collection *const collection, const Key &key, const Value &value)
 
template<class Collection >
void gtl::InsertOrDieNoPrint (Collection *const collection, const typename Collection::value_type &value)
 
template<class Collection >
void gtl::InsertOrDie (Collection *const collection, const typename Collection::value_type &value)
 
template<class Collection >
void gtl::InsertOrDie (Collection *const collection, const typename Collection::value_type::first_type &key, const typename Collection::value_type::second_type &data)
 
template<typename Collection >
auto & gtl::InsertKeyOrDie (Collection *const collection, const typename Collection::value_type::first_type &key)
 
template<class Collection , class Key , class Value >
bool gtl::FindCopy (const Collection &collection, const Key &key, Value *const value)
 
template<class Collection , class Key >
bool gtl::ContainsKey (const Collection &collection, const Key &key)
 
template<class Collection >
const Collection::value_type::second_type & gtl::FindOrDie (const Collection &collection, const typename Collection::value_type::first_type &key)
 
template<class Collection >
const Collection::value_type::second_type & gtl::FindOrDieNoPrint (const Collection &collection, const typename Collection::value_type::first_type &key)
 Same as FindOrDie above, but doesn't log the key on failure.
 
template<class Collection >
Collection::value_type::second_type & gtl::FindOrDieNoPrint (Collection &collection, const typename Collection::value_type::first_type &key)
 Same as above, but returns a non-const reference.
 
template<class Collection >
Collection::value_type::second_type & gtl::LookupOrInsert (Collection *const collection, const typename Collection::value_type::first_type &key, const typename Collection::value_type::second_type &value)