mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-24 21:55:29 +00:00
use template instead of macro,
no template parsing in debug.h git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32676 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
75f6ced64b
commit
1dda726507
@ -197,45 +197,46 @@ void LyXErr::endl()
|
||||
|
||||
|
||||
// It seems not possible to instantiate operator template out of class body
|
||||
#define STREAM_OPERATOR(t) \
|
||||
{\
|
||||
if (l.enabled()){\
|
||||
l.stream() << t;\
|
||||
if (l.second_used()){\
|
||||
l.second() << t;\
|
||||
ProgressInterface::instance()->lyxerrFlush();\
|
||||
}\
|
||||
}\
|
||||
return l;\
|
||||
template<class T>
|
||||
LyXErr & toStream(LyXErr & l, T t)
|
||||
{
|
||||
if (l.enabled()){
|
||||
l.stream() << t;
|
||||
if (l.second_used()){
|
||||
l.second() << t;
|
||||
ProgressInterface::instance()->lyxerrFlush();
|
||||
}
|
||||
}
|
||||
return l;
|
||||
}
|
||||
|
||||
|
||||
LyXErr & operator<<(LyXErr & l, void const * t)
|
||||
STREAM_OPERATOR(t)
|
||||
{ return toStream(l, t); }
|
||||
LyXErr & operator<<(LyXErr & l, char const * t)
|
||||
STREAM_OPERATOR(t)
|
||||
{ return toStream(l, t); }
|
||||
LyXErr & operator<<(LyXErr & l, char t)
|
||||
STREAM_OPERATOR(t)
|
||||
{ return toStream(l, t); }
|
||||
LyXErr & operator<<(LyXErr & l, int t)
|
||||
STREAM_OPERATOR(t)
|
||||
{ return toStream(l, t); }
|
||||
LyXErr & operator<<(LyXErr & l, unsigned int t)
|
||||
STREAM_OPERATOR(t)
|
||||
{ return toStream(l, t); }
|
||||
LyXErr & operator<<(LyXErr & l, long t)
|
||||
STREAM_OPERATOR(t)
|
||||
{ return toStream(l, t); }
|
||||
LyXErr & operator<<(LyXErr & l, unsigned long t)
|
||||
STREAM_OPERATOR(t)
|
||||
{ return toStream(l, t); }
|
||||
LyXErr & operator<<(LyXErr & l, double t)
|
||||
STREAM_OPERATOR(t)
|
||||
{ return toStream(l, t); }
|
||||
LyXErr & operator<<(LyXErr & l, string const & t)
|
||||
STREAM_OPERATOR(t)
|
||||
{ return toStream(l, t); }
|
||||
LyXErr & operator<<(LyXErr & l, docstring const & t)
|
||||
STREAM_OPERATOR(to_utf8(t));
|
||||
{ return toStream(l, to_utf8(t)); }
|
||||
LyXErr & operator<<(LyXErr & l, FileName const & t)
|
||||
STREAM_OPERATOR(t)
|
||||
{ return toStream(l, t); }
|
||||
LyXErr & operator<<(LyXErr & l, ostream &(*t)(ostream &))
|
||||
STREAM_OPERATOR(t)
|
||||
{ return toStream(l, t); }
|
||||
LyXErr & operator<<(LyXErr & l, ios_base &(*t)(ios_base &))
|
||||
STREAM_OPERATOR(t)
|
||||
{ return toStream(l, t); }
|
||||
|
||||
|
||||
// The global instance
|
||||
|
Loading…
Reference in New Issue
Block a user