This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [v3] Fix second half of libstdc++/6745


Jonathan Lennox <lennox@cs.columbia.edu> writes:

| Here's a suggestion.  Have a template function
| 
|   template<typename _CharT, typename _Traits>
|   bool __streambuf_is_stdin_and_tty(const basic_streambuf<_CharT, _Traits>*)
|   {
|     return false;
|   }
| 
| And then declare the specializations
| 
|   template<> bool __streambuf_is_stdin_and_tty<char, traits<char> >(const streambuf*);
|   template<> bool __streambuf_is_stdin_and_tty<wchar_t, traits<wchar_t> >(const wstreambuf*);

This cannot work because being attached with a TTY is dyanmic property
of streambuf and not a static property -- that is one can rebind the
rdbuf() to another stream buffer.

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]