Opened 14 years ago

Closed 13 years ago

Last modified 13 years ago

#2749 closed Library Submissions (wontfix)

[any] multi method for boost::any and modified boost::any to fit multi method

Reported by: nowake@… Owned by: nasonov
Milestone: Boost 1.39.0 Component: any
Version: Boost 1.38.0 Severity: Optimization
Keywords: any multimethod dispatcher Cc:

Description

I tried to implement multimethod using Modern C++ Design's multi method technique.

Multimethod.hpp::

Multi method for boost::any. To specialize MultiMethod::Traits template, you can fit your boost::any like classes (check Holder.hpp). This class necessary loki/LokiTypeInfo.h and is_call_possible.
And you must "entry" multi method before using multi methods. (same as Modern C++ Design's multi methods)

Holder.hpp::

Costomized boost::any for multi method. This class set unsigned int every class type to access multi method in constant time, and this class can also use multimethod holder.

Please see attached main.cpp to check samples.

Attachments (7)

Multimethod.hpp (85.9 KB ) - added by nowake@… 14 years ago.
Multi method for boost::any
Holder.hpp (9.4 KB ) - added by anonymous 14 years ago.
Customized boost::any to fit multi method
MemberFunctionChecker.hpp (3.6 KB ) - added by anonymous 14 years ago.
http://groups.google.com/group/comp.lang.c++.moderated/tree/browse_frm/thread/4f7c7a96f9afbe44/c95a7b4c645e449f#doc_e5fbc9305539f699
main.cpp (17.8 KB ) - added by nowake@… 14 years ago.
sample code
Multimethod.2.hpp (83.1 KB ) - added by nowake@… 14 years ago.
Multi method for boost::any (update: dispatch in constant-time using boost::unorderd_map)
Multimethod.3.hpp (86.9 KB ) - added by nowake@… 14 years ago.
Update MultiMethod to enhance flexibility of return value.
Multimethod.4.hpp (48.4 KB ) - added by nowake@… 14 years ago.
Update MultiMethod to enhance flexibility.

Download all attachments as: .zip

Change History (9)

by nowake@…, 14 years ago

Attachment: Multimethod.hpp added

Multi method for boost::any

by anonymous, 14 years ago

Attachment: Holder.hpp added

Customized boost::any to fit multi method

by nowake@…, 14 years ago

Attachment: main.cpp added

sample code

by nowake@…, 14 years ago

Attachment: Multimethod.2.hpp added

Multi method for boost::any (update: dispatch in constant-time using boost::unorderd_map)

by nowake@…, 14 years ago

Attachment: Multimethod.3.hpp added

Update MultiMethod to enhance flexibility of return value.

by nowake@…, 14 years ago

Attachment: Multimethod.4.hpp added

Update MultiMethod to enhance flexibility.

comment:1 by anonymous, 13 years ago

Resolution: wontfix
Status: newclosed

Sandbox is a better place for this ticket.

comment:2 by nasonov, 13 years ago

Anonymous who closed the bug was me.

Note: See TracTickets for help on using tickets.