[type-traits] virtual function type trait check

I was wondering if it were possible to make a is_virtual_function type trait check. Example: class B { public: virtual void complicatedFunction() { } }; class D : public B { public: void complicatedFnction() { static_assert(**check if D::complicatedFnction() is virtual **); // notice the misspelling. } };

I'm no expert in type traits. For this is there a way to combine: SFINAE extending from a class and making a function with the same signature and adding "static" will cause an error (can't do that for virtual functions) enable_if specialization ...? John Maddock wrote:
Chris wrote:
I was wondering if it were possible to make a is_virtual_function type trait check.
Interesting challenge! Off the top of my head I can't see any way of doing this... but I'm sure someone will jump in with an idea or two?
John. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (2)
-
Chris
-
John Maddock