• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Trouble with std::basic_ostringstream and libc++
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trouble with std::basic_ostringstream and libc++


  • Subject: Re: Trouble with std::basic_ostringstream and libc++
  • From: Howard Hinnant <email@hidden>
  • Date: Mon, 09 Jul 2012 10:58:12 -0400

On Jul 9, 2012, at 10:15 AM, Jesper Papmehl-Dufay wrote:

> I am having trouble getting code that uses std::basic_ostringstream to work when building with libc++. The same code works without any problems when building using libstdc++. (In both cases I’m building with Xcode 4.3.3, Apple LLVM compiler 3.1, and C++ Language Dialect set to C++11.)
>
> For example, the following program fails to compile:
>
> #include <sstream>
>
> int main(int argc, const char* argv[]) {
>    std::basic_ostringstream<int> myStream;
>    return 0;
> }
>
> with the error messages listed at the end of this mail.
>
> If I change std::basic_ostringstream<int> to std::ostringstream, it builds with our any problems (though I actually need a specific character type, so I cannot use ostringstream in my real program).
> And if I change the standard C++ library to libstdc++, it also builds without any problems.
>
> Does anyone have any idea what I might be doing wrong? Or is this simply a bug in libc++?

The stream classes are only defined to work with char and wchar_t because Table 81 defines only ctype<char> and ctype<wchar_t>.

Will std::basic_ostringstream<wchar_t> myStream work for you?

Howard


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Trouble with std::basic_ostringstream and libc++
      • From: Jesper Papmehl-Dufay <email@hidden>
References: 
 >Trouble with std::basic_ostringstream and libc++ (From: Jesper Papmehl-Dufay <email@hidden>)

  • Prev by Date: Trouble with std::basic_ostringstream and libc++
  • Next by Date: Re: Trouble with std::basic_ostringstream and libc++
  • Previous by thread: Trouble with std::basic_ostringstream and libc++
  • Next by thread: Re: Trouble with std::basic_ostringstream and libc++
  • Index(es):
    • Date
    • Thread