Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template<class T> class ref_ptr;
- struct Foo {
- typedef ref_ptr<const Foo> Ptr;
- };
- template<typename T> struct Exp {
- Exp();
- template<typename OtherT> Exp(const OtherT &value);
- };
- template <typename MethodT> struct MethodInfo;
- template <typename ObjectT, typename ResultT> struct MethodInfo<ResultT (ObjectT::*)() const> {
- typedef const ObjectT Object;
- };
- template<typename MethodT> Exp<void> Call(const Exp<typename MethodInfo<MethodT>::Object *> &object, MethodT method) {
- }
- template<typename MethodT> Exp<void> Call(const Exp<ref_ptr<typename MethodInfo<MethodT>::Object> > &object, MethodT method) {
- }
- template<typename ObjectT> struct SingleRecordFoo : public Foo {
- void id() const;
- };
- struct ObservedThing : public SingleRecordFoo<ObservedThing> {
- void f() {
- Exp<ObservedThing::Ptr> thing;
- (void)Call(thing, &ObservedThing::id);
- }
- };
Add Comment
Please, Sign In to add comment