I'm attempting to build the following application; pinched from http://en.cppreference.com/w/cpp/locale/messages.
#include <iostream>
#include <locale>
int main()
{
std::locale loc("de_DE");
auto& facet = std::use_facet<std::messages<char>>(loc);
auto cat = facet.open("libstdc++", loc, "/usr/share/locale");
std::cout << "\"please\" in German: "
<< facet.get(cat, 0, 0, "please") << '\n'
<< "\"thank you\" in German: "
<< facet.get(cat, 0, 0, "thank you") << '\n';
facet.close(cat);
}
main.cpp:134:45: error: too many arguments to function call, expected 2, have 3
auto cat = facet.open("libstdc++", loc, "/usr/share/locale");
~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/locale:3528:5: note: 'open' declared here
_LIBCPP_ALWAYS_INLINE
^
/usr/include/c++/v1/__config:84:32: note: instantiated from:
#define _LIBCPP_ALWAYS_INLINE __attribute__ ((__visibility__("hidden"), __always_inline__))
^
1 error generated.
I've removed the third argument to open and all is well. The problem is i wish to specify a location for my text domain other than the default. I've looked into bindtextdomain but fail to get that recognised on my machine as well. Any hints?
Environment:
This issue was addressed at cppreference.com. see comments section above.
The example on cppreference.com is now updated to use the standard messages::open