#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iterator>

using namespace std;

// print contents of vector-of-string
ostream& operator<<(ostream& out, const vector<string>& v) {
    vector<string>::const_iterator p;

    for ( p=v.begin(); p!=v.end(); ++p )
        out << *p << (p+1!=v.end()? ", " : "");

    return out << endl;
}

int main (int argc, char** argv)
{
    vector<string> abc;

    abc.push_back("d");
    abc.push_back("x");
    abc.push_back("a");
    abc.push_back("ä");
    abc.push_back("f");
    abc.push_back("å");
    abc.push_back("A");
    abc.push_back("B");
    abc.push_back("n");
    abc.push_back("Ü");
    abc.push_back("Ø");
    abc.push_back("Æ");
    
    cout << "-----------------------------------" << endl;
    cout << "Swedish sorting:" << endl;
    
    sort (abc.begin(), abc.end(), locale("sv_SE"));

    cout <<endl<< abc <<endl;

    
    cout << "-----------------------------------" << endl;
    cout << "C-style sorting:" << endl;

    sort (abc.begin(), abc.end(), locale::classic());

    cout <<endl<< abc <<endl;
    cout << "-----------------------------------" << endl;

    return 0;
}
