[v3] Fix second half of libstdc++/6745
Gabriel Dos Reis
gdr@integrable-solutions.net
Wed Nov 20 06:10:00 GMT 2002
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
More information about the Gcc-patches
mailing list