Back to Arangodb

Boost.Locale: collate.cpp

3rdParty/boost/1.78.0/libs/locale/doc/html/collate_8cpp-example.html

3.12.9.11.2 KB
Original Source

| | Boost.Locale |

collate.cpp

Example of using collation functions

//

// Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)

//

// Distributed under the Boost Software License, Version 1.0. (See

// accompanying file LICENSE_1_0.txt or copy at

// http://www.boost.org/LICENSE\_1\_0.txt)

//

#include <iostream>

#include <string>

#include <set>

#include <boost/locale.hpp>

using namespace std;

using namespace boost::locale;

int main()

{

generator gen;

std::locale::global(gen(""));

typedef std::set<std::string,std::locale> set_type;

set_type all_strings;

while(!cin.eof()) {

std::string tmp;

getline(cin,tmp);

all_strings.insert(tmp);

}

for(set_type::iterator p=all_strings.begin();p!=all_strings.end();++p) {

cout<<*p<<endl;

}

}

// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4