Re: how do i get to_string to work

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



thanks for a very quick response
here is a minimal program

#include <iostream>
#include <string>
using namespace std;
int main()
{
  cout << to_string(12)
  return 0;
}
to_string is actually declared  in basic_string.h as

  inline string
  to_string(long long __val)
  { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf,
					   4 * sizeof(long long),
					   "%lld", __val); }

  inline string
  to_string(unsigned long long __val)
  { return __gnu_cxx::__to_xstring<string>(&std::vsnprintf,
					   4 * sizeof(unsigned long long),
					   "%llu", __val); }

  inline string
  to_string(long double __val)
  {
    const int __n =
      __gnu_cxx::__numeric_traits<long double>::__max_exponent10 + 20;
    return __gnu_cxx::__to_xstring<string>(&std::vsnprintf, __n,
					   "%Lf", __val);
  }

-- 
BenC
Get your facts first, and then you can distort them as much as you please.
âFacts are stubborn, but statistics are more pliable.âÂMark Twain
Benjamin I. Czaczkes PhD



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux