lists.preview.boost.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview
newer
iostreams and serial ports help

[function] using with CRTP

older
iostreams::stream: flush doesn't...

Russell L. Carter

23 Jan 2008 23 Jan '08
1:01 p.m.

Hi, This is probably a novice template question. I am curious what I am doing wrong here, where I'm trying to get a function object holding a base member of a CRTP class. gcc 4.2.3 complains about: type/value mismatch at argument 1 in template parameter list for 'template<class Derived> template template<class Derived> template<class> class MHBase> struct MHBase< <template-parameter-1-1> >::fooFO Any help appreciated! Thanks, Russell #include #include <iostream> class MHBAccessor { template<class> friend class MHBase; template<class Derived> static int foo(Derived& derived, int i) { return derived.foo_(i); } }; typedef boost::function FooFunc; template <class Derived> struct MHBase { Derived& derived() { return static_cast(*this); } int foo(int i) { return MHBAccessor::foo(this->derived(), i); } template