Template Class Collate_byname

The facet collate is responsible for specifying the sorting rules used for sorting strings. The base class collate does a simple lexical comparison on the binary values in the string. collate_byname can perform much more complex comparisons that are based on the Unicode sorting algorithm. If you construct collate_byname with a const char* that refers to a file, then that file is scanned by collate_byname's constructor for information to customize the collation rules.

  collate_byname<char> col("en_US");
  

If the file "en_US" exists, has collate data in it, and there are no syntax errors in the data, then col will behave as dictated by that data. If the file exists, but does not have collate data in it, then the facet will behave as if it were constructed with "C". If the file has collate data in it, but there is a syntax error in the data, or if the file does not exist, then a std::runtime_error is thrown.