Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
std Namespace Reference

STL namespace. More...

Classes

class  allocator
 STL class.
 
class  array
 STL class.
 
class  atomic
 STL class.
 
class  atomic_ref
 STL class.
 
class  auto_ptr
 STL class.
 
class  bad_alloc
 STL class.
 
class  bad_cast
 STL class.
 
class  bad_exception
 STL class.
 
class  bad_typeid
 STL class.
 
class  basic_fstream
 STL class.
 
class  basic_ifstream
 STL class.
 
class  basic_ios
 STL class.
 
class  basic_iostream
 STL class.
 
class  basic_istream
 STL class.
 
class  basic_istringstream
 STL class.
 
class  basic_ofstream
 STL class.
 
class  basic_ostream
 STL class.
 
class  basic_ostringstream
 STL class.
 
class  basic_string
 STL class.
 
class  basic_string_view
 STL class.
 
class  basic_stringstream
 STL class.
 
class  bitset
 STL class.
 
class  complex
 STL class.
 
class  deque
 STL class.
 
class  domain_error
 STL class.
 
class  error_category
 STL class.
 
class  error_code
 STL class.
 
class  error_condition
 STL class.
 
class  exception
 STL class.
 
class  forward_list
 STL class.
 
class  fstream
 STL class.
 
struct  hash< gtl::IntType< IntTypeName, ValueType > >
 
struct  hash< operations_research::StrongIndex< Tag > >
 
struct  hash< operations_research::StrongInt64< Tag > >
 
struct  hash< util_intops::StrongInt< StrongIntName, ValueType > >
 
class  ifstream
 STL class.
 
class  invalid_argument
 STL class.
 
class  ios
 STL class.
 
class  ios_base
 STL class.
 
class  istream
 STL class.
 
class  istringstream
 STL class.
 
class  jthread
 STL class.
 
class  length_error
 STL class.
 
class  list
 STL class.
 
class  lock_guard
 STL class.
 
class  logic_error
 STL class.
 
class  map
 STL class.
 
class  multimap
 STL class.
 
class  multiset
 STL class.
 
class  mutex
 STL class.
 
struct  numeric_limits< operations_research::StrongIndex< Tag > >
 
struct  numeric_limits< operations_research::StrongInt64< Tag > >
 
class  ofstream
 STL class.
 
class  ostream
 STL class.
 
class  ostringstream
 STL class.
 
class  out_of_range
 STL class.
 
class  overflow_error
 STL class.
 
class  pair
 STL class.
 
class  priority_queue
 STL class.
 
class  queue
 STL class.
 
class  range_error
 STL class.
 
class  recursive_mutex
 STL class.
 
class  recursive_timed_mutex
 STL class.
 
class  runtime_error
 STL class.
 
class  set
 STL class.
 
class  shared_lock
 STL class.
 
class  shared_mutex
 STL class.
 
class  shared_ptr
 STL class.
 
class  shared_timed_mutex
 STL class.
 
class  smart_ptr
 STL class.
 
class  span
 STL class.
 
class  stack
 STL class.
 
class  string
 STL class.
 
class  string_view
 STL class.
 
class  stringstream
 STL class.
 
class  system_error
 STL class.
 
class  thread
 STL class.
 
class  timed_mutex
 STL class.
 
class  u16string
 STL class.
 
class  u16string_view
 STL class.
 
class  u32string
 STL class.
 
class  u32string_view
 STL class.
 
class  u8string
 STL class.
 
class  u8string_view
 STL class.
 
class  underflow_error
 STL class.
 
class  unique_lock
 STL class.
 
class  unique_ptr
 STL class.
 
class  unordered_map
 STL class.
 
class  unordered_multimap
 STL class.
 
class  unordered_multiset
 STL class.
 
class  unordered_set
 STL class.
 
class  valarray
 STL class.
 
class  vector
 STL class.
 
class  weak_ptr
 STL class.
 
class  wfstream
 STL class.
 
class  wifstream
 STL class.
 
class  wios
 STL class.
 
class  wistream
 STL class.
 
class  wistringstream
 STL class.
 
class  wofstream
 STL class.
 
class  wostream
 STL class.
 
class  wostringstream
 STL class.
 
class  wstring
 STL class.
 
class  wstring_view
 STL class.
 
class  wstringstream
 STL class.
 

Detailed Description

STL namespace.

– STD NUMERIC_LIMITS SUPPORT -------------------------------------------—

– STD HASHING SUPPORT --------------------------------------------------—

Allows it to be used as a key to hashable containers.

Note
this is technically undefined behavior! We are adding things into the std namespace for a reason though – we are providing new operations on types which are themselves defined with this namespace. Without this, these operator overloads cannot be found via ADL. If these definitions are not found via ADL, they must be #included before they're used, which requires this header to be included before apparently independent other headers.

For example, base/logging.h defines various template functions to implement CHECK_EQ(x, y) and stream x and y into the log in the event the check fails. It does so via the function template MakeCheckOpValueString: template<class T> void MakeCheckOpValueString(strstream* ss, const T& v) { (*ss) << v; } Because 'logging.h' is included before 'stl_logging.h', subsequent CHECK_EQ(v1, v2) for vector<...> typed variable v1 and v2 can only find these operator definitions via ADL.

Even this solution has problems – it may pull unintended operators into the namespace as well, allowing them to also be found via ADL, and creating code that only works with a particular order of includes. Long term, we need to move all of the definitions into namespace std, bet we need to ensure no one references them first. This lets us take that step. We cannot define them in both because that would create ambiguous overloads when both are found.