CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CompositionAxes_impl.hh
Go to the documentation of this file.
1 #ifndef CASM_clex_CompositionAxes_impl
2 #define CASM_clex_CompositionAxes_impl
3 
5 
6 namespace CASM {
7 
8 template <typename IterType>
9 void CompositionAxes::insert_enumerated(IterType begin, IterType end) {
10  int i = 0;
11  for (; begin != end; ++begin, ++i) {
12  while (all_axes.count(std::to_string(i))) ++i;
13  all_axes[std::to_string(i)] = *begin;
14  enumerated.insert(std::to_string(i));
15  }
16 }
17 
18 } // namespace CASM
19 
20 #endif
std::string to_string(ENUM val)
Return string representation of enum class.
Definition: io_traits.hh:172
Main CASM namespace.
Definition: APICommand.hh:8
std::set< std::string > enumerated
std::map< std::string, CompositionConverter > all_axes
void insert_enumerated(IterType begin, IterType end)
Iterate over list of CompositionConverter and insert each one as an enumerated axes set with a unique...