开发者

Is there a storage of std::locale source files?

开发者 https://www.devze.com 2023-01-16 21:14 出处:网络
I need std::locale class, that defines ru_RU.CP1251 standart facets (ctype, collate, numeric, …). I feel sombody have released all main

I need std::locale class, that defines ru_RU.CP1251 standart facets (ctype, collate, numeric, …). I feel sombody have released all main locales. Is there a libraries, or source files storage where I can download it and just include in my project like this, for example:

开发者_运维百科
#include <some_lib\ru_locale.hpp> // library
#include <locale>
#include <io>

int main(int argc, char *argv[])
{
  std::locale ru = ru_locale(); // from library
  std::locale custom_locale(std::locale(""), ru, numpunct);
  std::cout.imbue(custom_locale);
  float float_num = 1.123;
  std::cout << float_num;
  return 0;
}


What's wrong with just doing:

std::locale ru("ru_RU.cp1251");

It seems quite suerfluous to make a specific class for that?

0

精彩评论

暂无评论...
验证码 换一张
取 消