[EMAIL PROTECTED] writes:
> I am having trouble compiling some templated code that uses functors in
> g++. It compiles fine in VC8.
Really? I though MicroSoft cleaned up its act WRT binding non-const
references to temporaries, but apparently not.
> Any idea what I could do to make this work with g++?
Binding temporary objects to non-const references is not allowed.
You need several const qualifiers:
> class add
> {
> public:
T& operator()(T& t1, const T& t_inc) const { ... }
...
> template <class output_functor>
void do_loop(const output_functor& o)
...
> struct output
> {
void operator()(const int n) const { ... }
Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
_______________________________________________
help-gplusplus mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gplusplus