#ifndef SikiMultimethodH #define SikiMultimethodH /*--------------------------------------------------------------------------- Multimethod.hpp --------------------------------------------------------------------------- Copyright (C) 2009/01 - 2009 Nowake nowake@fircewinds.net ----------------------------------------------------------------------------*/ #include #include #include #include #include #include "MemberFunctionChecker.hpp" // http://groups.google.com/group/comp.lang.c++.moderated/tree/browse_frm/thread/4f7c7a96f9afbe44/c95a7b4c645e449f#doc_e5fbc9305539f699 /////////////////////////////////////////////////////////////////////////// // multi method executor /////////////////////////////////////////////////////////////////////////// struct Multimethod { Multimethod() {}; public: template struct Traits; class BadMultimethod : public std::bad_cast { public: virtual const char * what() const throw() { return "Bad Multimethod apply: no entried argument set."; }; }; private: //////////////////////////////////////////////////////////////////////// template static T& find(const unsigned int pos1) { static std::vector r; if (r.size() <= pos1) { r.resize(pos1+1, 0); } return r[pos1]; }; template static T& find(unsigned int pos1, unsigned int pos2) { static std::vector > r; if (r.size() <= pos1) { r.resize(pos1+1); } if (r[pos1].size() <= pos2) { r[pos1].resize(pos2+1, 0); } return r[pos1][pos2]; }; template static T& find(unsigned int pos1, unsigned int pos2, unsigned int pos3) { static std::vector > > r; if (r.size() <= pos1) { r.resize(pos1+1); } if (r[pos1].size() <= pos2) { r[pos1].resize(pos2+1); } if (r[pos1][pos2].size() <= pos3) { r[pos1][pos2].resize(pos3+1, 0); } return r[pos1][pos2][pos3]; }; template static T& find(unsigned int pos1, unsigned int pos2, unsigned int pos3, unsigned int pos4) { struct r1 { std::vector r; }; struct r2 { std::vector r; }; struct r3 { std::vector r; }; struct r4 { std::vector r; }; static r4 r; // C4503 workaround if (r.r.size() <= pos1) { r.r.resize(pos1+1); } if (r.r[pos1].r.size() <= pos2) { r.r[pos1].r.resize(pos2+1); } if (r.r[pos1].r[pos2].r.size() <= pos3) { r.r[pos1].r[pos2].r.resize(pos3+1); } if (r.r[pos1].r[pos2].r[pos3].r.size() <= pos4) { r.r[pos1].r[pos2].r[pos3].r.resize(pos4+1, 0); } return r.r[pos1].r[pos2].r[pos3].r[pos4]; }; /*template static T& find(unsigned int pos1, unsigned int pos2, unsigned int pos3, unsigned int pos4, unsigned int pos5) { struct r1 { std::vector r; }; struct r2 { std::vector r; }; struct r3 { std::vector r; }; struct r4 { std::vector r; }; struct r5 { std::vector r; }; static r5 r; // C4503 workaround if (r.r.size() <= pos1) { r.r.resize(pos1+1); } if (r.r[pos1].r.size() <= pos2) { r.r[pos1].r.resize(pos2+1); } if (r.r[pos1].r[pos2].r.size() <= pos3) { r.r[pos1].r[pos2].r.resize(pos3+1); } if (r.r[pos1].r[pos2].r[pos3].r.size() <= pos4) { r.r[pos1].r[pos2].r[pos3].r.resize(pos4+1, 0); } if (r.r[pos1].r[pos2].r[pos3].r[pos4].r.size() <= pos5) { r.r[pos1].r[pos2].r[pos3].r[pos4].r.resize(pos5+1, 0); } return r.r[pos1].r[pos2].r[pos3].r[pos4].r[pos5]; };*/ //////////////////////////////////////////////////////////////////////// template static T& find(const Loki::TypeInfo& type1) { typedef std::map map1; static map1 rr; std::pair t1(rr.insert(make_pair(type1, static_cast(0)))); return t1.first->second; }; template static T& find(const Loki::TypeInfo& type1, const Loki::TypeInfo& type2) { typedef std::map map1; typedef std::map map2; static map2 rr; std::pair t2(rr.insert(make_pair(type2, map1()))); std::pair t1(t2.first->second.insert(make_pair(type1, static_cast(0)))); return t1.first->second; }; template static T& find(const Loki::TypeInfo& type1, const Loki::TypeInfo& type2, const Loki::TypeInfo& type3) { typedef std::map map1; typedef std::map map2; typedef std::map map3; static map3 rr; std::pair t3(rr.insert(make_pair(type3, map2()))); std::pair t2(t3.first->second.insert(make_pair(type2, map1()))); std::pair t1(t2.first->second.insert(make_pair(type1, static_cast(0)))); return t1.first->second; }; template static T& find(const Loki::TypeInfo& type1, const Loki::TypeInfo& type2, const Loki::TypeInfo& type3, const Loki::TypeInfo& type4) { typedef std::map map1; typedef std::map map2; typedef std::map map3; typedef std::map map4; static map4 rr; std::pair t4(rr.insert(make_pair(type4, map3()))); std::pair t3(t4.first->second.insert(make_pair(type3, map2()))); std::pair t2(t3.first->second.insert(make_pair(type2, map1()))); std::pair t1(t2.first->second.insert(make_pair(type1, static_cast(0)))); return t1.first->second; }; /*template static T& find(const Loki::TypeInfo& type1, const Loki::TypeInfo& type2, const Loki::TypeInfo& type3, const Loki::TypeInfo& type4, const Loki::TypeInfo& type5) { typedef std::map map1; typedef std::map map2; typedef std::map map3; typedef std::map map4; typedef std::map map5; static map5 rr; std::pair t5(rr.insert(make_pair(type5, map4()))); std::pair t4(t5.first->second.insert(make_pair(type4, map3()))); std::pair t3(t4.first->second.insert(make_pair(type3, map2()))); std::pair t2(t3.first->second.insert(make_pair(type2, map1()))); std::pair t1(t2.first->second.insert(make_pair(type1, static_cast(0)))); return t1.first->second; };*/ private: //////////////////////////////////////////////////////////////////////// template struct filter00 { static R trampoline(HHH& m00) { return Traits::cast(m00)(); }; }; template struct filter00 { static R trampoline(HHH& m00) { Traits::cast(m00)(); return R(); }; }; public: template static bool entry() { struct Local { static R trampoline(HHH& m00) { return filter00::value), HHH, M00>::trampoline(m00); }; }; typedef R (*T00)(HHH&); static bool t00((find(Traits::id()) = &Local::trampoline) != 0); return true; }; template static R apply(HHH& m00) { typedef R (*T)(HHH&); T t(find(Traits::id(m00))); if (!t) throw BadMultimethod(); return t(m00); }; private: //////////////////////////////////////////////////////////////////////// template struct filter01 { static R trampoline(HHH& m00, HHH& a01) { return Traits::cast(m00)(Traits::cast(a01)); }; static R trampoline(M00& m00, HHH& a01) { return m00(Traits::cast(a01)); }; static R trampoline(HHH& m00, A01& a01) { return Traits::cast(m00)(a01); }; }; template struct filter01 { static R trampoline(HHH& m00, HHH& a01) { Traits::cast(m00)(Traits::cast(a01)); return R(); }; static R trampoline(M00& m00, HHH& a01) { m00(Traits::cast(a01)); return R(); }; static R trampoline(HHH& m00, A01& a01) { Traits::cast(m00)(a01); return R(); }; }; public: template static bool entry() { struct Local { static R trampoline(HHH& m00, HHH& a01) { return filter01::value), HHH, M00, A01>::trampoline(m00, a01); }; static R trampoline(M00& m00, HHH& a01) { return filter01::value), HHH, M00, A01>::trampoline(m00, a01); }; static R trampoline(HHH& m00, A01& a01) { return filter01::value), HHH, M00, A01>::trampoline(m00, a01); }; }; typedef R (*T00)(HHH&, HHH&); static bool t00((find(Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T01)(M00&, HHH&); static bool t01((find(Traits::id()) = &Local::trampoline) != 0); typedef R (*T02)(HHH&, A01&); static bool t02((find(Traits::id()) = &Local::trampoline) != 0); return true; }; template static R apply(HHH& m00, HHH& a01) { typedef R (*T)(HHH&, HHH&); T t(find(Traits::id(m00), Traits::id(a01))); if (!t) throw BadMultimethod(); return t(m00, a01); }; template static R apply(T00& m00, HHH& a01, typename Traits::index_type* = 0) { typedef R (*T)(T00&, HHH&); T t(find(Traits::id(a01))); if (!t) throw BadMultimethod(); return t(m00, a01); }; template static R apply(HHH& m00, T00& a01, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, T00&); T t(find(Traits::id(m00))); if (!t) throw BadMultimethod(); return t(m00, a01); }; template static R apply(const T00& m00, HHH& a01, typename Traits::index_type* = 0) { typedef R (*T)(const T00&, HHH&); T t(find(Traits::id(a01))); if (!t) throw BadMultimethod(); return t(m00, a01); }; template static R apply(HHH& m00, const T00& a01, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, const T00&); T t(find(Traits::id(m00))); if (!t) throw BadMultimethod(); return t(m00, a01); }; private: //////////////////////////////////////////////////////////////////////// template struct filter02 { static R trampoline(HHH& m00, HHH& a01, HHH& a02) { return Traits::cast(m00)(Traits::cast(a01), Traits::cast(a02)); }; static R trampoline(M00& m00, HHH& a01, HHH& a02) { return m00(Traits::cast(a01), Traits::cast(a02)); }; static R trampoline(HHH& m00, A01& a01, HHH& a02) { return Traits::cast(m00)(a01, Traits::cast(a02)); }; static R trampoline(HHH& m00, HHH& a01, A02& a02) { return Traits::cast(m00)(Traits::cast(a01), a02); }; static R trampoline(HHH& m00, A01& a01, A02& a02) { return Traits::cast(m00)(a01, a02); }; static R trampoline(M00& m00, HHH& a01, A02& a02) { return m00(Traits::cast(a01), a02); }; static R trampoline(M00& m00, A01& a01, HHH& a02) { return m00(a01, Traits::cast(a02)); }; }; template struct filter02 { static R trampoline(HHH& m00, HHH& a01, HHH& a02) { Traits::cast(m00)(Traits::cast(a01), Traits::cast(a02)); return R(); }; static R trampoline(M00& m00, HHH& a01, HHH& a02) { m00(Traits::cast(a01), Traits::cast(a02)); return R(); }; static R trampoline(HHH& m00, A01& a01, HHH& a02) { Traits::cast(m00)(a01, Traits::cast(a02)); return R(); }; static R trampoline(HHH& m00, HHH& a01, A02& a02) { Traits::cast(m00)(Traits::cast(a01), a02); return R(); }; static R trampoline(HHH& m00, A01& a01, A02& a02) { Traits::cast(m00)(a01, a02); return R(); }; static R trampoline(M00& m00, HHH& a01, A02& a02) { m00(Traits::cast(a01), a02); return R(); }; static R trampoline(M00& m00, A01& a01, HHH& a02) { m00(a01, Traits::cast(a02)); return R(); }; }; public: template static bool entry() { struct Local { static R trampoline(HHH& m00, HHH& a01, HHH& a02) { return filter02::value), HHH, M00, A01, A02>::trampoline(m00, a01, a02); }; static R trampoline(M00& m00, HHH& a01, HHH& a02) { return filter02::value), HHH, M00, A01, A02>::trampoline(m00, a01, a02); }; static R trampoline(HHH& m00, A01& a01, HHH& a02) { return filter02::value), HHH, M00, A01, A02>::trampoline(m00, a01, a02); }; static R trampoline(HHH& m00, HHH& a01, A02& a02) { return filter02::value), HHH, M00, A01, A02>::trampoline(m00, a01, a02); }; static R trampoline(HHH& m00, A01& a01, A02& a02) { return filter02::value), HHH, M00, A01, A02>::trampoline(m00, a01, a02); }; static R trampoline(M00& m00, HHH& a01, A02& a02) { return filter02::value), HHH, M00, A01, A02>::trampoline(m00, a01, a02); }; static R trampoline(M00& m00, A01& a01, HHH& a02) { return filter02::value), HHH, M00, A01, A02>::trampoline(m00, a01, a02); }; }; typedef R (*T00)(HHH&, HHH&, HHH&); static bool t00((find(Traits::id(), Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T01)(M00&, HHH&, HHH&); static bool t01((find(Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T02)(HHH&, A01&, HHH&); static bool t02((find(Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T03)(HHH&, HHH&, A02&); static bool t03((find(Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T04)(HHH&, A01&, A02&); static bool t04((find(Traits::id()) = &Local::trampoline) != 0); typedef R (*T05)(M00&, HHH&, A02&); static bool t05((find(Traits::id()) = &Local::trampoline) != 0); typedef R (*T06)(M00&, A01&, HHH&); static bool t06((find(Traits::id()) = &Local::trampoline) != 0); return true; }; template static R apply(HHH& m00, HHH& a01, HHH& a02) { typedef R (*T)(HHH&, HHH&, HHH&); T t(find(Traits::id(m00), Traits::id(a01), Traits::id(a02))); if (!t) throw BadMultimethod(); return t(m00, a01, a02); }; template static R apply(T00& m00, HHH& a01, HHH& a02, typename Traits::index_type* = 0) { typedef R (*T)(T00&, HHH&, HHH&); T t(find(Traits::id(a01), Traits::id(a02))); if (!t) throw BadMultimethod(); return t(m00, a01, a02); }; template static R apply(HHH& m00, T00& a01, HHH& a02, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, T00&, HHH&); T t(find(Traits::id(m00), Traits::id(ma02))); if (!t) throw BadMultimethod(); return t(m00, a01, a02); }; template static R apply(HHH& m00, HHH& a01, T00& a02, typename Traits::index_type* = 0) { typedef R (*T)(const T00&, HHH&); T t(find(Traits::id(m00), Traits::id(a01))); if (!t) throw BadMultimethod(); return t(m00, a01, a02); }; template static R apply(HHH& m00, T00& a01, T01& a02, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, T00&, T01&); T t(find(Traits::id(m00))); if (!t) throw BadMultimethod(); return t(m00, a01, a02); }; template static R apply(T00& m00, HHH& a01, T01& a02, typename Traits::index_type* = 0) { typedef R (*T)(T00&, HHH&, T01&); T t(find(Traits::id(a01))); if (!t) throw BadMultimethod(); return t(m00, a01, a02); }; template static R apply(T00& m00, T01& a01, HHH& a02, typename Traits::index_type* = 0) { typedef R (*T)(T00&, T01&, HHH&); T t(find(Traits::id(a02))); if (!t) throw BadMultimethod(); return t(m00, a01, a02); }; template static R apply(const T00& m00, HHH& a01, HHH& a02, typename Traits::index_type* = 0) { typedef R (*T)(const T00&, HHH&, HHH&); T t(find(Traits::id(a01), Traits::id(a02))); if (!t) throw BadMultimethod(); return t(m00, a01, a02); }; template static R apply(HHH& m00, const T00& a01, HHH& a02, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, const T00&, HHH&); T t(find(Traits::id(m00), Traits::id(ma02))); if (!t) throw BadMultimethod(); return t(m00, a01, a02); }; template static R apply(HHH& m00, HHH& a01, const T00& a02, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, HHH&, const T00); T t(find(Traits::id(m00), Traits::id(a01))); if (!t) throw BadMultimethod(); return t(m00, a01, a02); }; template static R apply(HHH& m00, const T00& a01, T01& a02, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, const T00&, T01&); T t(find(Traits::id(m00))); if (!t) throw BadMultimethod(); return t(m00, a01, a02); }; template static R apply(HHH& m00, T00& a01, const T01& a02, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, T00&, const T01&); T t(find(Traits::id(m00))); if (!t) throw BadMultimethod(); return t(m00, a01, a02); }; template static R apply(HHH& m00, const T00& a01, const T01& a02, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, const T00&, const T01&); T t(find(Traits::id(m00))); if (!t) throw BadMultimethod(); return t(m00, a01, a02); }; template static R apply(const T00& m00, HHH& a01, T01& a02, typename Traits::index_type* = 0) { typedef R (*T)(const T00&, HHH&, T01&); T t(find(Traits::id(a01))); if (!t) throw BadMultimethod(); return t(m00, a01, a02); }; template static R apply(T00& m00, HHH& a01, const T01& a02, typename Traits::index_type* = 0) { typedef R (*T)(T00&, HHH&, const T01&); T t(find(Traits::id(a01))); if (!t) throw BadMultimethod(); return t(m00, a01, a02); }; template static R apply(const T00& m00, HHH& a01, const T01& a02, typename Traits::index_type* = 0) { typedef R (*T)(const T00&, HHH&, const T01&); T t(find(Traits::id(a01))); if (!t) throw BadMultimethod(); return t(m00, a01, a02); }; template static R apply(const T00& m00, T01& a01, HHH& a02, typename Traits::index_type* = 0) { typedef R (*T)(const T00&, T01&, HHH&); T t(find(Traits::id(a02))); if (!t) throw BadMultimethod(); return t(m00, a01, a02); }; template static R apply(T00& m00, const T01& a01, HHH& a02, typename Traits::index_type* = 0) { typedef R (*T)(T00&, const T01&, HHH&); T t(find(Traits::id(a02))); if (!t) throw BadMultimethod(); return t(m00, a01, a02); }; template static R apply(const T00& m00, const T01& a01, HHH& a02, typename Traits::index_type* = 0) { typedef R (*T)(const T00&, const T01&, HHH&); T t(find(Traits::id(a02))); if (!t) throw BadMultimethod(); return t(m00, a01, a02); }; private: //////////////////////////////////////////////////////////////////////// template struct filter03 { static R trampoline(HHH& m00, HHH& a01, HHH& a02, HHH& a03) { return Traits::cast(m00)(Traits::cast(a01), Traits::cast(a02), Traits::cast(a03)); }; static R trampoline(M00& m00, HHH& a01, HHH& a02, HHH& a03) { return m00(Traits::cast(a01), Traits::cast(a02), Traits::cast(a03)); }; static R trampoline(HHH& m00, A01& a01, HHH& a02, HHH& a03) { return Traits::cast(m00)(a01, Traits::cast(a02), Traits::cast(a03)); }; static R trampoline(HHH& m00, HHH& a01, A02& a02, HHH& a03) { return Traits::cast(m00)(Traits::cast(a01), a02, Traits::cast(a03)); }; static R trampoline(HHH& m00, HHH& a01, HHH& a02, A03& a03) { return Traits::cast(m00)(Traits::cast(a01), Traits::cast(a02), a03); }; static R trampoline(M00& m00, A01& a01, HHH& a02, HHH& a03) { return m00(a01, Traits::cast(a02), Traits::cast(a03)); }; static R trampoline(M00& m00, HHH& a01, A02& a02, HHH& a03) { return m00(Traits::cast(a01), a02, Traits::cast(a03)); }; static R trampoline(M00& m00, HHH& a01, HHH& a02, A03& a03) { return m00(Traits::cast(a01), Traits::cast(a02), a03); }; static R trampoline(HHH& m00, A01& a01, A02& a02, HHH& a03) { return Traits::cast(m00)(a01, a02, Traits::cast(a03)); }; static R trampoline(HHH& m00, A01& a01, HHH& a02, A03& a03) { return Traits::cast(m00)(a01, Traits::cast(a02), a03); }; static R trampoline(HHH& m00, HHH& a01, A02& a02, A03& a03) { return Traits::cast(m00)(Traits::cast(a01), a02, a03); }; static R trampoline(HHH& m00, A01& a01, A02& a02, A03& a03) { return Traits::cast(m00)(a01, a02, a03); }; static R trampoline(M00& m00, HHH& a01, A02& a02, A03& a03) { return m00(Traits::cast(a01), a02, a03); }; static R trampoline(M00& m00, A01& a01, HHH& a02, A03& a03) { return m00(a01, Traits::cast(a02), a03); }; static R trampoline(M00& m00, A01& a01, A02& a02, HHH& a03) { return m00(a01, a02, Traits::cast(a03)); }; }; template struct filter03 { static R trampoline(HHH& m00, HHH& a01, HHH& a02, HHH& a03) { Traits::cast(m00)(Traits::cast(a01), Traits::cast(a02), Traits::cast(a03)); return R(); }; static R trampoline(M00& m00, HHH& a01, HHH& a02, HHH& a03) { m00(Traits::cast(a01), Traits::cast(a02), Traits::cast(a03)); return R(); }; static R trampoline(HHH& m00, A01& a01, HHH& a02, HHH& a03) { Traits::cast(m00)(a01, Traits::cast(a02), Traits::cast(a03)); return R(); }; static R trampoline(HHH& m00, HHH& a01, A02& a02, HHH& a03) { Traits::cast(m00)(Traits::cast(a01), a02, Traits::cast(a03)); return R(); }; static R trampoline(HHH& m00, HHH& a01, HHH& a02, A03& a03) { Traits::cast(m00)(Traits::cast(a01), Traits::cast(a02), a03); return R(); }; static R trampoline(M00& m00, A01& a01, HHH& a02, HHH& a03) { m00(a01, Traits::cast(a02), Traits::cast(a03)); return R(); }; static R trampoline(M00& m00, HHH& a01, A02& a02, HHH& a03) { m00(Traits::cast(a01), a02, Traits::cast(a03)); return R(); }; static R trampoline(M00& m00, HHH& a01, HHH& a02, A03& a03) { m00(Traits::cast(a01), Traits::cast(a02), a03); return R(); }; static R trampoline(HHH& m00, A01& a01, A02& a02, HHH& a03) { Traits::cast(m00)(a01, a02, Traits::cast(a03)); return R(); }; static R trampoline(HHH& m00, A01& a01, HHH& a02, A03& a03) { Traits::cast(m00)(a01, Traits::cast(a02), a03); return R(); }; static R trampoline(HHH& m00, HHH& a01, A02& a02, A03& a03) { Traits::cast(m00)(Traits::cast(a01), a02, a03); return R(); }; static R trampoline(HHH& m00, A01& a01, A02& a02, A03& a03) { Traits::cast(m00)(a01, a02, a03); return R(); }; static R trampoline(M00& m00, HHH& a01, A02& a02, A03& a03) { m00(Traits::cast(a01), a02, a03); return R(); }; static R trampoline(M00& m00, A01& a01, HHH& a02, A03& a03) { m00(a01, Traits::cast(a02), a03); return R(); }; static R trampoline(M00& m00, A01& a01, A02& a02, HHH& a03) { m00(a01, a02, Traits::cast(a03)); return R(); }; }; public: template static bool entry() { struct Local { static R trampoline(HHH& m00, HHH& a01, HHH& a02, HHH& a03) { return filter03::value), HHH, M00, A01, A02, A03>::trampoline(m00, a01, a02, a03); }; static R trampoline(M00& m00, HHH& a01, HHH& a02, HHH& a03) { return filter03::value), HHH, M00, A01, A02, A03>::trampoline(m00, a01, a02, a03); }; static R trampoline(HHH& m00, A01& a01, HHH& a02, HHH& a03) { return filter03::value), HHH, M00, A01, A02, A03>::trampoline(m00, a01, a02, a03); }; static R trampoline(HHH& m00, HHH& a01, A02& a02, HHH& a03) { return filter03::value), HHH, M00, A01, A02, A03>::trampoline(m00, a01, a02, a03); }; static R trampoline(HHH& m00, HHH& a01, HHH& a02, A03& a03) { return filter03::value), HHH, M00, A01, A02, A03>::trampoline(m00, a01, a02, a03); }; static R trampoline(M00& m00, A01& a01, HHH& a02, HHH& a03) { return filter03::value), HHH, M00, A01, A02, A03>::trampoline(m00, a01, a02, a03); }; static R trampoline(M00& m00, HHH& a01, A02& a02, HHH& a03) { return filter03::value), HHH, M00, A01, A02, A03>::trampoline(m00, a01, a02, a03); }; static R trampoline(M00& m00, HHH& a01, HHH& a02, A03& a03) { return filter03::value), HHH, M00, A01, A02, A03>::trampoline(m00, a01, a02, a03); }; static R trampoline(HHH& m00, A01& a01, A02& a02, HHH& a03) { return filter03::value), HHH, M00, A01, A02, A03>::trampoline(m00, a01, a02, a03); }; static R trampoline(HHH& m00, A01& a01, HHH& a02, A03& a03) { return filter03::value), HHH, M00, A01, A02, A03>::trampoline(m00, a01, a02, a03); }; static R trampoline(HHH& m00, HHH& a01, A02& a02, A03& a03) { return filter03::value), HHH, M00, A01, A02, A03>::trampoline(m00, a01, a02, a03); }; static R trampoline(HHH& m00, A01& a01, A02& a02, A03& a03) { return filter03::value), HHH, M00, A01, A02, A03>::trampoline(m00, a01, a02, a03); }; static R trampoline(M00& m00, HHH& a01, A02& a02, A03& a03) { return filter03::value), HHH, M00, A01, A02, A03>::trampoline(m00, a01, a02, a03); }; static R trampoline(M00& m00, A01& a01, HHH& a02, A03& a03) { return filter03::value), HHH, M00, A01, A02, A03>::trampoline(m00, a01, a02, a03); }; static R trampoline(M00& m00, A01& a01, A02& a02, HHH& a03) { return filter03::value), HHH, M00, A01, A02, A03>::trampoline(m00, a01, a02, a03); }; }; typedef R (*T00)(HHH&, HHH&, HHH&, HHH&); static bool t00((find(Traits::id(), Traits::id(), Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T01)(M00&, HHH&, HHH&, HHH&); static bool t01((find(Traits::id(), Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T02)(HHH&, A01&, HHH&, HHH&); static bool t02((find(Traits::id(), Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T03)(HHH&, HHH&, A02&, HHH&); static bool t03((find(Traits::id(), Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T04)(HHH&, HHH&, HHH&, A03&); static bool t04((find(Traits::id(), Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T05)(M00&, A01&, HHH&, HHH&); static bool t05((find(Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T06)(M00&, HHH&, A02&, HHH&); static bool t06((find(Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T07)(M00&, A01&, HHH&, HHH&); static bool t07((find(Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T08)(HHH&, A01&, A02&, A03&); static bool t08((find(Traits::id()) = &Local::trampoline) != 0); typedef R (*T09)(M00&, HHH&, A02&, A03&); static bool t09((find(Traits::id()) = &Local::trampoline) != 0); typedef R (*T10)(M00&, A01&, HHH&, A03&); static bool t10((find(Traits::id()) = &Local::trampoline) != 0); typedef R (*T11)(M00&, A01&, A02&, HHH&); static bool t11((find(Traits::id()) = &Local::trampoline) != 0); return true; }; template static R apply(HHH& m00, HHH& a01, HHH& a02, HHH& a03) { typedef R (*T)(HHH&, HHH&, HHH&, HHH&); T t(find(Traits::id(m00), Traits::id(a01), Traits::id(a02), Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(T00& m00, HHH& a01, HHH& a02, HHH& a03, typename Traits::index_type* = 0) { typedef R (*T)(T00&, HHH&, HHH&, HHH&); T t(find(Traits::id(a01), Traits::id(a02), Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(const T00& m00, HHH& a01, HHH& a02, HHH& a03, typename Traits::index_type* = 0) { typedef R (*T)(const T00&, HHH&, HHH&, HHH&); T t(find(Traits::id(a01), Traits::id(a02), Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(HHH& m00, T00& a01, HHH& a02, HHH& a03, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, T00&, HHH&, HHH&); T t(find(Traits::id(m00), Traits::id(a02), Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(HHH& m00, const T00& a01, HHH& a02, HHH& a03, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, const T00&, HHH&, HHH&); T t(find(Traits::id(m00), Traits::id(a02), Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(HHH& m00, HHH& a01, T00& a02, HHH& a03, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, HHH&, T00&, HHH&); T t(find(Traits::id(m00), Traits::id(a01), Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(HHH& m00, HHH& a01, const T00& a02, HHH& a03, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, HHH&, const T00&, HHH&); T t(find(Traits::id(m00), Traits::id(a01), Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(HHH& m00, HHH& a01, HHH& a02, T00& a03, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, HHH&, HHH&, T00&); T t(find(Traits::id(m00), Traits::id(a01), Traits::id(a02))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(HHH& m00, HHH& a01, HHH& a02, const T00& a03, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, HHH&, HHH&, const T00&); T t(find(Traits::id(m00), Traits::id(a01), Traits::id(a02))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(T00& m00, T01& a01, HHH& a02, HHH& a03, typename Traits::index_type* = 0) { typedef R (*T)(T00&, T01&, HHH&, HHH&); T t(find(Traits::id(a02), Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(const T00& m00, T01& a01, HHH& a02, HHH& a03, typename Traits::index_type* = 0) { typedef R (*T)(const T00&, T01&, HHH&, HHH&); T t(find(Traits::id(a02), Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(T00& m00, const T01& a01, HHH& a02, HHH& a03, typename Traits::index_type* = 0) { typedef R (*T)(T00&, const T01&, HHH&, HHH&); T t(find(Traits::id(a02), Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(const T00& m00, const T01& a01, HHH& a02, HHH& a03, typename Traits::index_type* = 0) { typedef R (*T)(const T00&, const T01&, HHH&, HHH&); T t(find(Traits::id(a02), Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(T00& m00, HHH& a01, T01& a02, HHH& a03, typename Traits::index_type* = 0) { typedef R (*T)(T00&, HHH&, T01&, HHH&); T t(find(Traits::id(a01), Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(const T00& m00, HHH& a01, T01& a02, HHH& a03, typename Traits::index_type* = 0) { typedef R (*T)(const T00&, HHH&, T01&, HHH&); T t(find(Traits::id(a01), Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(T00& m00, HHH& a01, const T01& a02, HHH& a03, typename Traits::index_type* = 0) { typedef R (*T)(T00&, HHH&, const T01&, HHH&); T t(find(Traits::id(a01), Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(const T00& m00, HHH& a01, const T01& a02, HHH& a03, typename Traits::index_type* = 0) { typedef R (*T)(const T00&, HHH&, const T01&, HHH&); T t(find(Traits::id(a01), Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(T00& m00, HHH& a01, HHH& a02, T01& a03, typename Traits::index_type* = 0) { typedef R (*T)(T00&, HHH&, HHH&, T01&); T t(find(Traits::id(a01), Traits::id(a02))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(const T00& m00, HHH& a01, HHH& a02, T01& a03, typename Traits::index_type* = 0) { typedef R (*T)(const T00&, HHH&, HHH&, T01&); T t(find(Traits::id(a01), Traits::id(a02))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(T00& m00, HHH& a01, HHH& a02, const T01& a03, typename Traits::index_type* = 0) { typedef R (*T)(T00&, HHH&, HHH&, const T01&); T t(find(Traits::id(a01), Traits::id(a02))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(const T00& m00, HHH& a01, HHH& a02, const T01& a03, typename Traits::index_type* = 0) { typedef R (*T)(const T00&, HHH&, HHH&, const T01&); T t(find(Traits::id(a01), Traits::id(a02))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(HHH& m00, T00& a01, T01& a02, HHH& a03, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, T00&, T01&, HHH&); T t(find(Traits::id(m00), Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(HHH& m00, const T00& a01, T01& a02, HHH& a03, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, const T00&, T01&, HHH&); T t(find(Traits::id(m00), Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(HHH& m00, T00& a01, const T01& a02, HHH& a03, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, T00&, const T01&, HHH&); T t(find(Traits::id(m00), Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(HHH& m00, const T00& a01, const T01& a02, HHH& a03, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, const T00&, const T01&, HHH&); T t(find(Traits::id(m00), Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(HHH& m00, T00& a01, HHH& a02, T01& a03, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, T00&, HHH&, T01&); T t(find(Traits::id(m00), Traits::id(a02))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(HHH& m00, const T00& a01, HHH& a02, T01& a03, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, const T00&, HHH&, T01&); T t(find(Traits::id(m00), Traits::id(a02))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(HHH& m00, T00& a01, HHH& a02, const T01& a03, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, T00&, HHH&, const T01&); T t(find(Traits::id(m00), Traits::id(a02))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(HHH& m00, const T00& a01, HHH& a02, const T01& a03, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, const T00&, HHH&, const T01&); T t(find(Traits::id(m00), Traits::id(a02))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(HHH& m00, HHH& a01, T00& a02, T01& a03, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, HHH&, T00&, T01&); T t(find(Traits::id(m00), Traits::id(a01))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(HHH& m00, HHH& a01, const T00& a02, T01& a03, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, HHH&, const T00&, T01&); T t(find(Traits::id(m00), Traits::id(a01))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(HHH& m00, HHH& a01, T00& a02, const T01& a03, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, HHH&, T00&, const T01&); T t(find(Traits::id(m00), Traits::id(a01))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(HHH& m00, HHH& a01, const T00& a02, const T01& a03, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, HHH&, const T00&, const T01&); T t(find(Traits::id(m00), Traits::id(a01))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(HHH& m00, T00& a01, T01& a02, T02& a03, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, T00&, T01&, T02&); T t(find(Traits::id(m00))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(HHH& m00, const T00& a01, T01& a02, T02& a03, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, const T00&, T01&, T02&); T t(find(Traits::id(m00))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(HHH& m00, T00& a01, const T01& a02, T02& a03, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, T00&, const T01&, T02&); T t(find(Traits::id(m00))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(HHH& m00, T00& a01, T01& a02, const T02& a03, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, T00&, T01&, const T02&); T t(find(Traits::id(m00))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(HHH& m00, const T00& a01, const T01& a02, T02& a03, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, const T00&, const T01&, T02&); T t(find(Traits::id(m00))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(HHH& m00, const T00& a01, T01& a02, const T02& a03, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, const T00&, T01&, const T02&); T t(find(Traits::id(m00))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(HHH& m00, T00& a01, const T01& a02, const T02& a03, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, T00&, const T01&, const T02&); T t(find(Traits::id(m00))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(HHH& m00, const T00& a01, const T01& a02, const T02& a03, typename Traits::index_type* = 0) { typedef R (*T)(HHH&, const T00&, const T01&, const T02&); T t(find(Traits::id(m00))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(T00& m00, HHH& a01, T01& a02, T02& a03, typename Traits::index_type* = 0) { typedef R (*T)(T00&, HHH&, T01&, T02&); T t(find(Traits::id(a01))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(const T00& m00, HHH& a01, T01& a02, T02& a03, typename Traits::index_type* = 0) { typedef R (*T)(const T00&, HHH&, T01&, T02&); T t(find(Traits::id(a01))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(T00& m00, HHH& a01, const T01& a02, T02& a03, typename Traits::index_type* = 0) { typedef R (*T)(T00&, HHH&, const T01&, T02&); T t(find(Traits::id(a01))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(T00& m00, HHH& a01, T01& a02, const T02& a03, typename Traits::index_type* = 0) { typedef R (*T)(T00&, HHH&, T01&, const T02&); T t(find(Traits::id(a01))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(const T00& m00, HHH& a01, const T01& a02, T02& a03, typename Traits::index_type* = 0) { typedef R (*T)(const T00&, HHH&, const T01&, T02&); T t(find(Traits::id(a01))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(const T00& m00, HHH& a01, T01& a02, const T02& a03, typename Traits::index_type* = 0) { typedef R (*T)(const T00&, HHH&, T01&, const T02&); T t(find(Traits::id(a01))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(const T00& m00, HHH& a01, const T01& a02, const T02& a03, typename Traits::index_type* = 0) { typedef R (*T)(const T00&, HHH&, const T01&, const T02&); T t(find(Traits::id(a01))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(T00& m00, T01& a01, HHH& a02, T02& a03, typename Traits::index_type* = 0) { typedef R (*T)(T00&, T01&, HHH&, T02&); T t(find(Traits::id(a02))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(const T00& m00, T01& a01, HHH& a02, T02& a03, typename Traits::index_type* = 0) { typedef R (*T)(const T00&, T01&, HHH&, T02&); T t(find(Traits::id(a02))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(T00& m00, const T01& a01, HHH& a02, T02& a03, typename Traits::index_type* = 0) { typedef R (*T)(T00&, const T01&, HHH&, T02&); T t(find(Traits::id(a02))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(T00& m00, T01& a01, HHH& a02, const T02& a03, typename Traits::index_type* = 0) { typedef R (*T)(T00&, T01&, HHH&, const T02&); T t(find(Traits::id(a02))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(const T00& m00, const T01& a01, HHH& a02, T02& a03, typename Traits::index_type* = 0) { typedef R (*T)(const T00&, const T01&, HHH&, T02&); T t(find(Traits::id(a02))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(const T00& m00, T01& a01, HHH& a02, const T02& a03, typename Traits::index_type* = 0) { typedef R (*T)(const T00&, T01&, HHH&, const T02&); T t(find(Traits::id(a02))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(T00& m00, const T01& a01, HHH& a02, const T02& a03, typename Traits::index_type* = 0) { typedef R (*T)(T00&, const T01&, HHH&, const T02&); T t(find(Traits::id(a02))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(const T00& m00, const T01& a01, HHH& a02, const T02& a03, typename Traits::index_type* = 0) { typedef R (*T)(const T00&, const T01&, HHH&, const T02&); T t(find(Traits::id(a02))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(T00& m00, T01& a01, T02& a02, HHH& a03, typename Traits::index_type* = 0) { typedef R (*T)(T00&, T01&, T02&, HHH&); T t(find(Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(const T00& m00, T01& a01, T02& a02, HHH& a03, typename Traits::index_type* = 0) { typedef R (*T)(const T00&, T01&, T02&, HHH&); T t(find(Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(T00& m00, const T01& a01, T02& a02, HHH& a03, typename Traits::index_type* = 0) { typedef R (*T)(T00&, const T01&, T02&, HHH&); T t(find(Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(T00& m00, T01& a01, const T02& a02, HHH& a03, typename Traits::index_type* = 0) { typedef R (*T)(T00&, T01&, const T02&, HHH&); T t(find(Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(const T00& m00, const T01& a01, T02& a02, HHH& a03, typename Traits::index_type* = 0) { typedef R (*T)(const T00&, const T01&, T02&, HHH&); T t(find(Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(const T00& m00, T01& a01, const T02& a02, HHH& a03, typename Traits::index_type* = 0) { typedef R (*T)(const T00&, T01&, const T02&, HHH&); T t(find(Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(T00& m00, const T01& a01, const T02& a02, HHH& a03, typename Traits::index_type* = 0) { typedef R (*T)(T00&, const T01&, const T02&, HHH&); T t(find(Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; template static R apply(const T00& m00, const T01& a01, const T02& a02, HHH& a03, typename Traits::index_type* = 0) { typedef R (*T)(const T00&, const T01&, const T02&, HHH&); T t(find(Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03); }; /*private: //////////////////////////////////////////////////////////////////////// template struct filter04 { static R trampoline(HHH& m00, HHH& a01, HHH& a02, HHH& a03, HHH& a04) { return Traits::cast(m00)(Traits::cast(a01), Traits::cast(a02), Traits::cast(a03), Traits::cast(a04)); }; static R trampoline(M00& m00, HHH& a01, HHH& a02, HHH& a03, HHH& a04) { return m00(Traits::cast(a01), Traits::cast(a02), Traits::cast(a03), Traits::cast(a04)); }; static R trampoline(HHH& m00, A01& a01, HHH& a02, HHH& a03, HHH& a04) { return Traits::cast(m00)(a01, Traits::cast(a02), Traits::cast(a03), Traits::cast(a04)); }; static R trampoline(HHH& m00, HHH& a01, A02& a02, HHH& a03, HHH& a04) { return Traits::cast(m00)(Traits::cast(a01), a02, Traits::cast(a03), Traits::cast(a04)); }; static R trampoline(HHH& m00, HHH& a01, HHH& a02, A03& a03, HHH& a04) { return Traits::cast(m00)(Traits::cast(a01), Traits::cast(a02), a03, Traits::cast(a04)); }; static R trampoline(HHH& m00, HHH& a01, HHH& a02, HHH& a03, A04& a04) { return Traits::cast(m00)(Traits::cast(a01), Traits::cast(a02), Traits::cast(a03), a04); }; static R trampoline(M00& m00, A01& a01, HHH& a02, HHH& a03, HHH& a04) { return m00(a01, Traits::cast(a02), Traits::cast(a03), Traits::cast(a04)); }; static R trampoline(M00& m00, HHH& a01, A02& a02, HHH& a03, HHH& a04) { return m00(Traits::cast(a01), a02, Traits::cast(a03), Traits::cast(a04)); }; static R trampoline(M00& m00, HHH& a01, HHH& a02, A03& a03, HHH& a04) { return m00(Traits::cast(a01), Traits::cast(a02), a03, Traits::cast(a04)); }; static R trampoline(M00& m00, HHH& a01, HHH& a02, HHH& a03, A04& a04) { return m00(Traits::cast(a01), Traits::cast(a02), Traits::cast(a03), a04); }; static R trampoline(HHH& m00, A01& a01, A02& a02, HHH& a03, HHH& a04) { return Traits::cast(m00)(a01, a02, Traits::cast(a03), Traits::cast(a04)); }; static R trampoline(HHH& m00, A01& a01, HHH& a02, A03& a03, HHH& a04) { return Traits::cast(m00)(a01, Traits::cast(a02), a03, Traits::cast(a04)); }; static R trampoline(HHH& m00, A01& a01, HHH& a02, HHH& a03, A04& a04) { return Traits::cast(m00)(a01, Traits::cast(a02), Traits::cast(a03), a04); }; static R trampoline(HHH& m00, HHH& a01, A02& a02, A03& a03, HHH& a04) { return Traits::cast(m00)(Traits::cast(a01), a02, a03, Traits::cast(a04)); }; static R trampoline(HHH& m00, HHH& a01, A02& a02, HHH& a03, A04& a04) { return Traits::cast(m00)(Traits::cast(a01), a02, Traits::cast(a03), a04); }; static R trampoline(HHH& m00, HHH& a01, HHH& a02, A03& a03, A04& a04) { return Traits::cast(m00)(Traits::cast(a01), Traits::cast(a02), a03, a04); }; static R trampoline(M00& m00, A01& a01, A02& a02, HHH& a03, HHH& a04) { return m00(a01, a02, Traits::cast(a03), Traits::cast(a04)); }; static R trampoline(M00& m00, A01& a01, HHH& a02, A03& a03, HHH& a04) { return m00(a01, Traits::cast(a02), a03, Traits::cast(a04)); }; static R trampoline(M00& m00, A01& a01, HHH& a02, HHH& a03, A04& a04) { return m00(a01, Traits::cast(a02), Traits::cast(a03), a04); }; static R trampoline(HHH& m00, A01& a01, A02& a02, A03& a03, HHH& a04) { return Traits::cast(m00)(a01, a02, a03, Traits::cast(a04)); }; static R trampoline(HHH& m00, A01& a01, A02& a02, HHH& a03, A04& a04) { return Traits::cast(m00)(a01, a02, Traits::cast(a03), a04); }; static R trampoline(HHH& m00, HHH& a01, A02& a02, A03& a03, A04& a04) { return Traits::cast(m00)(Traits::cast(a01), a02, a03, a04); }; static R trampoline(HHH& m00, A01& a01, A02& a02, A03& a03, A04& a04) { return Traits::cast(m00)(a01, a02, a03, a04); }; static R trampoline(M00& m00, HHH& a01, A02& a02, A03& a03, A04& a04) { return m00(Traits::cast(a01), a02, a03, a04); }; static R trampoline(M00& m00, A01& a01, HHH& a02, A03& a03, A04& a04) { return m00(a01, Traits::cast(a02), a03, a04); }; static R trampoline(M00& m00, A01& a01, A02& a02, HHH& a03, A04& a04) { return m00(a01, a02, Traits::cast(a03), a04); }; static R trampoline(M00& m00, A01& a01, A02& a02, A03& a03, HHH& a04) { return m00(a01, a02, a03, Traits::cast(a04)); }; }; template struct filter04 { static R trampoline(HHH& m00, HHH& a01, HHH& a02, HHH& a03, HHH& a04) { Traits::cast(m00)(Traits::cast(a01), Traits::cast(a02), Traits::cast(a03), Traits::cast(a04)); return R(); }; static R trampoline(M00& m00, HHH& a01, HHH& a02, HHH& a03, HHH& a04) { m00(Traits::cast(a01), Traits::cast(a02), Traits::cast(a03), Traits::cast(a04)); return R(); }; static R trampoline(HHH& m00, A01& a01, HHH& a02, HHH& a03, HHH& a04) { Traits::cast(m00)(a01, Traits::cast(a02), Traits::cast(a03), Traits::cast(a04)); return R(); }; static R trampoline(HHH& m00, HHH& a01, A02& a02, HHH& a03, HHH& a04) { Traits::cast(m00)(Traits::cast(a01), a02, Traits::cast(a03), Traits::cast(a04)); return R(); }; static R trampoline(HHH& m00, HHH& a01, HHH& a02, A03& a03, HHH& a04) { Traits::cast(m00)(Traits::cast(a01), Traits::cast(a02), a03, Traits::cast(a04)); return R(); }; static R trampoline(HHH& m00, HHH& a01, HHH& a02, HHH& a03, A04& a04) { Traits::cast(m00)(Traits::cast(a01), Traits::cast(a02), Traits::cast(a03), a04); return R(); }; static R trampoline(M00& m00, A01& a01, HHH& a02, HHH& a03, HHH& a04) { m00(a01, Traits::cast(a02), Traits::cast(a03), Traits::cast(a04)); return R(); }; static R trampoline(M00& m00, HHH& a01, A02& a02, HHH& a03, HHH& a04) { m00(Traits::cast(a01), a02, Traits::cast(a03), Traits::cast(a04)); return R(); }; static R trampoline(M00& m00, HHH& a01, HHH& a02, A03& a03, HHH& a04) { m00(Traits::cast(a01), Traits::cast(a02), a03, Traits::cast(a04)); return R(); }; static R trampoline(M00& m00, HHH& a01, HHH& a02, HHH& a03, A04& a04) { m00(Traits::cast(a01), Traits::cast(a02), Traits::cast(a03), a04); return R(); }; static R trampoline(HHH& m00, A01& a01, A02& a02, HHH& a03, HHH& a04) { Traits::cast(m00)(a01, a02, Traits::cast(a03), Traits::cast(a04)); return R(); }; static R trampoline(HHH& m00, A01& a01, HHH& a02, A03& a03, HHH& a04) { Traits::cast(m00)(a01, Traits::cast(a02), a03, Traits::cast(a04)); return R(); }; static R trampoline(HHH& m00, A01& a01, HHH& a02, HHH& a03, A04& a04) { Traits::cast(m00)(a01, Traits::cast(a02), Traits::cast(a03), a04); return R(); }; static R trampoline(HHH& m00, HHH& a01, A02& a02, A03& a03, HHH& a04) { Traits::cast(m00)(Traits::cast(a01), a02, a03, Traits::cast(a04)); return R(); }; static R trampoline(HHH& m00, HHH& a01, A02& a02, HHH& a03, A04& a04) { Traits::cast(m00)(Traits::cast(a01), a02, Traits::cast(a03), a04); return R(); }; static R trampoline(HHH& m00, HHH& a01, HHH& a02, A03& a03, A04& a04) { Traits::cast(m00)(Traits::cast(a01), Traits::cast(a02), a03, a04); return R(); }; static R trampoline(M00& m00, A01& a01, A02& a02, HHH& a03, HHH& a04) { m00(a01, a02, Traits::cast(a03), Traits::cast(a04)); return R(); }; static R trampoline(M00& m00, A01& a01, HHH& a02, A03& a03, HHH& a04) { m00(a01, Traits::cast(a02), a03, Traits::cast(a04)); return R(); }; static R trampoline(M00& m00, A01& a01, HHH& a02, HHH& a03, A04& a04) { m00(a01, Traits::cast(a02), Traits::cast(a03), a04); return R(); }; static R trampoline(HHH& m00, A01& a01, A02& a02, A03& a03, HHH& a04) { Traits::cast(m00)(a01, a02, a03, Traits::cast(a04)); return R(); }; static R trampoline(HHH& m00, A01& a01, A02& a02, HHH& a03, A04& a04) { Traits::cast(m00)(a01, a02, Traits::cast(a03), a04); return R(); }; static R trampoline(HHH& m00, HHH& a01, A02& a02, A03& a03, A04& a04) { Traits::cast(m00)(Traits::cast(a01), a02, a03, a04); return R(); }; static R trampoline(HHH& m00, A01& a01, A02& a02, A03& a03, A04& a04) { Traits::cast(m00)(a01, a02, a03, a04); return R(); }; static R trampoline(M00& m00, HHH& a01, A02& a02, A03& a03, A04& a04) { m00(Traits::cast(a01), a02, a03, a04); return R(); }; static R trampoline(M00& m00, A01& a01, HHH& a02, A03& a03, A04& a04) { m00(a01, Traits::cast(a02), a03, a04); return R(); }; static R trampoline(M00& m00, A01& a01, A02& a02, HHH& a03, A04& a04) { m00(a01, a02, Traits::cast(a03), a04); return R(); }; static R trampoline(M00& m00, A01& a01, A02& a02, A03& a03, HHH& a04) { m00(a01, a02, a03, Traits::cast(a04)); return R(); }; }; public: template static bool entry() { struct Local { static R trampoline(HHH& m00, HHH& a01, HHH& a02, HHH& a03) { return filter04::value), HHH, M00, A01, A02, A03, A04>::trampoline(m00, a01, a02, a03, a04); }; static R trampoline(M00& m00, HHH& a01, HHH& a02, HHH& a03) { return filter04::value), HHH, M00, A01, A02, A03, A04>::trampoline(m00, a01, a02, a03, a04); }; static R trampoline(HHH& m00, A01& a01, HHH& a02, HHH& a03) { return filter04::value), HHH, M00, A01, A02, A03, A04>::trampoline(m00, a01, a02, a03, a04); }; static R trampoline(HHH& m00, HHH& a01, A02& a02, HHH& a03) { return filter04::value), HHH, M00, A01, A02, A03, A04>::trampoline(m00, a01, a02, a03, a04); }; static R trampoline(HHH& m00, HHH& a01, HHH& a02, A03& a03) { return filter04::value), HHH, M00, A01, A02, A03, A04>::trampoline(m00, a01, a02, a03, a04); }; static R trampoline(M00& m00, A01& a01, HHH& a02, HHH& a03) { return filter04::value), HHH, M00, A01, A02, A03, A04>::trampoline(m00, a01, a02, a03, a04); }; static R trampoline(M00& m00, HHH& a01, A02& a02, HHH& a03) { return filter04::value), HHH, M00, A01, A02, A03, A04>::trampoline(m00, a01, a02, a03, a04); }; static R trampoline(M00& m00, HHH& a01, HHH& a02, A03& a03) { return filter04::value), HHH, M00, A01, A02, A03, A04>::trampoline(m00, a01, a02, a03, a04); }; static R trampoline(HHH& m00, A01& a01, A02& a02, HHH& a03) { return filter04::value), HHH, M00, A01, A02, A03, A04>::trampoline(m00, a01, a02, a03, a04); }; static R trampoline(HHH& m00, A01& a01, HHH& a02, A03& a03) { return filter04::value), HHH, M00, A01, A02, A03, A04>::trampoline(m00, a01, a02, a03, a04); }; static R trampoline(HHH& m00, HHH& a01, A02& a02, A03& a03) { return filter04::value), HHH, M00, A01, A02, A03, A04>::trampoline(m00, a01, a02, a03, a04); }; static R trampoline(HHH& m00, A01& a01, A02& a02, A03& a03) { return filter04::value), HHH, M00, A01, A02, A03, A04>::trampoline(m00, a01, a02, a03, a04); }; static R trampoline(M00& m00, HHH& a01, A02& a02, A03& a03) { return filter04::value), HHH, M00, A01, A02, A03, A04>::trampoline(m00, a01, a02, a03, a04); }; static R trampoline(M00& m00, A01& a01, HHH& a02, A03& a03) { return filter04::value), HHH, M00, A01, A02, A03, A04>::trampoline(m00, a01, a02, a03, a04); }; static R trampoline(M00& m00, A01& a01, A02& a02, HHH& a03) { return filter04::value), HHH, M00, A01, A02, A03, A04>::trampoline(m00, a01, a02, a03, a04); }; }; typedef R (*T00)(HHH&, HHH&, HHH&, HHH&, HHH&); static bool t00((find(Traits::id(), Traits::id(), Traits::id(), Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T01)(M00&, HHH&, HHH&, HHH&, HHH&); static bool t01((find(Traits::id(), Traits::id(), Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T02)(HHH&, A01&, HHH&, HHH&, HHH&); static bool t02((find(Traits::id(), Traits::id(), Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T03)(HHH&, HHH&, A02&, HHH&, HHH&); static bool t03((find(Traits::id(), Traits::id(), Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T04)(HHH&, HHH&, HHH&, A03&, HHH&); static bool t04((find(Traits::id(), Traits::id(), Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T05)(HHH&, HHH&, HHH&, HHH&, A04&); static bool t05((find(Traits::id(), Traits::id(), Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T06)(M00&, A01&, HHH&, HHH&, HHH&); static bool t06((find(Traits::id(), Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T07)(M00&, HHH&, A02&, HHH&, HHH&); static bool t07((find(Traits::id(), Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T08)(M00&, HHH&, HHH&, A03&, HHH&); static bool t08((find(Traits::id(), Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T09)(M00&, HHH&, HHH&, HHH&, A04&); static bool t09((find(Traits::id(), Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T0a)(HHH&, A01&, A02&, HHH&, HHH&); static bool t0a((find(Traits::id(), Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T0b)(HHH&, A01&, HHH&, A03&, HHH&); static bool t0b((find(Traits::id(), Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T0c)(HHH&, A01&, HHH&, HHH&, A04&); static bool t0c((find(Traits::id(), Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T0d)(HHH&, HHH&, A02&, A03&, HHH&); static bool t0d((find(Traits::id(), Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T0e)(HHH&, HHH&, A02&, HHH&, A04&); static bool t0e((find(Traits::id(), Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T0f)(HHH&, HHH&, HHH&, A03&, A04&); static bool t0f((find(Traits::id(), Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T0g)(M00&, A01&, A02&, HHH&, HHH&); static bool t0g((find(Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T0h)(M00&, A01&, HHH&, A03&, HHH&); static bool t0h((find(Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T0i)(M00&, A01&, HHH&, HHH&, A04&); static bool t0i((find(Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T0j)(M00&, HHH&, A02&, A03&, HHH&); static bool t0j((find(Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T0k)(M00&, HHH&, A02&, HHH&, A04&); static bool t0k((find(Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T0l)(M00&, HHH&, HHH&, A03&, A04&); static bool t0l((find(Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T0m)(HHH&, A01&, A02&, A03&, HHH&); static bool t0m((find(Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T0n)(HHH&, A01&, A02&, HHH&, A04&); static bool t0n((find(Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T0o)(HHH&, HHH&, A02&, A03&, A04&); static bool t0o((find(Traits::id(), Traits::id()) = &Local::trampoline) != 0); typedef R (*T0p)(M00&, A01&, A02&, A03&, HHH&); static bool t0p((find(Traits::id()) = &Local::trampoline) != 0); typedef R (*T0q)(M00&, A01&, A02&, HHH&, A04&); static bool t0q((find(Traits::id()) = &Local::trampoline) != 0); typedef R (*T0r)(M00&, A01&, HHH&, A03&, A04&); static bool t0r((find(Traits::id()) = &Local::trampoline) != 0); typedef R (*T0s)(M00&, HHH&, A02&, A03&, A04&); static bool t0s((find(Traits::id()) = &Local::trampoline) != 0); typedef R (*T0t)(HHH&, A01&, A02&, A03&, A04&); static bool t0t((find(Traits::id()) = &Local::trampoline) != 0); return true; }; template static R apply(HHH& m00, HHH& a01, HHH& a02, HHH& a03, HHH& a04) { typedef R (*T)(HHH&, HHH&, HHH&, HHH&, HHH&); T t(find(Traits::id(m00), Traits::id(a01), Traits::id(a02), Traits::id(a03), Traits::id(a04))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03, a04); }; template static R apply(T00& m00, HHH& a01, HHH& a02, HHH& a03, HHH& a04) { typedef R (*T)(T00&, HHH&, HHH&, HHH&, HHH&); T t(find(Traits::id(a01), Traits::id(a02), Traits::id(a03), Traits::id(a04))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03, a04); }; template static R apply(const T00& m00, HHH& a01, HHH& a02, HHH& a03, HHH& a04) { typedef R (*T)(const T00&, HHH&, HHH&, HHH&, HHH&); T t(find(Traits::id(a01), Traits::id(a02), Traits::id(a03), Traits::id(a04))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03, a04); }; template static R apply(HHH& m00, T00& a01, HHH& a02, HHH& a03, HHH& a04) { typedef R (*T)(HHH&, T00&, HHH&, HHH&, HHH&); T t(find(Traits::id(m00), Traits::id(a02), Traits::id(a03), Traits::id(a04))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03, a04); }; template static R apply(HHH& m00, const T00& a01, HHH& a02, HHH& a03, HHH& a04) { typedef R (*T)(HHH&, const T00&, HHH&, HHH&, HHH&); T t(find(Traits::id(m00), Traits::id(a02), Traits::id(a03), Traits::id(a04))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03, a04); }; template static R apply(HHH& m00, HHH& a01, T00& a02, HHH& a03, HHH& a04) { typedef R (*T)(HHH&, HHH&, T00&, HHH&, HHH&); T t(find(Traits::id(m00), Traits::id(a01), Traits::id(a03), Traits::id(a04))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03, a04); }; template static R apply(HHH& m00, HHH& a01, const T00& a02, HHH& a03, HHH& a04) { typedef R (*T)(HHH&, HHH&, const T00&, HHH&, HHH&); T t(find(Traits::id(m00), Traits::id(a01), Traits::id(a03), Traits::id(a04))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03, a04); }; template static R apply(HHH& m00, HHH& a01, HHH& a02, T00& a03, HHH& a04) { typedef R (*T)(HHH&, HHH&, HHH&, T00&, HHH&); T t(find(Traits::id(m00), Traits::id(a01), Traits::id(a02), Traits::id(a04))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03, a04); }; template static R apply(HHH& m00, HHH& a01, HHH& a02, const T00& a03, HHH& a04) { typedef R (*T)(HHH&, HHH&, HHH&, const T00&, HHH&); T t(find(Traits::id(m00), Traits::id(a01), Traits::id(a02), Traits::id(a04))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03, a04); }; template static R apply(HHH& m00, HHH& a01, HHH& a02, HHH& a03, T00& a04) { typedef R (*T)(HHH&, HHH&, HHH&, HHH&, T00&); T t(find(Traits::id(m00), Traits::id(a01), Traits::id(a02), Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03, a04); }; template static R apply(HHH& m00, HHH& a01, HHH& a02, HHH& a03, const T00& a04) { typedef R (*T)(HHH&, HHH&, HHH&, HHH&, const T00&); T t(find(Traits::id(m00), Traits::id(a01), Traits::id(a02), Traits::id(a03))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03, a04); }; template static R apply(T00& m00, T01& a01, HHH& a02, HHH& a03, HHH& a04) { typedef R (*T)(T00&, T01&, HHH&, HHH&, HHH&); T t(find(Traits::id(a02), Traits::id(a03), Traits::id(a04))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03, a04); }; template static R apply(const T00& m00, T01& a01, HHH& a02, HHH& a03, HHH& a04) { typedef R (*T)(const T00&, T01&, HHH&, HHH&, HHH&); T t(find(Traits::id(a02), Traits::id(a03), Traits::id(a04))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03, a04); }; template static R apply(T00& m00, const T01& a01, HHH& a02, HHH& a03, HHH& a04) { typedef R (*T)(T00&, const T01&, HHH&, HHH&, HHH&); T t(find(Traits::id(a02), Traits::id(a03), Traits::id(a04))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03, a04); }; template static R apply(const T00& m00, const T01& a01, HHH& a02, HHH& a03, HHH& a04) { typedef R (*T)(const T00&, const T01&, HHH&, HHH&, HHH&); T t(find(Traits::id(a02), Traits::id(a03), Traits::id(a04))); if (!t) throw BadMultimethod(); return t(m00, a01, a02, a03, a04); }; */ }; /////////////////////////////////////////////////////////////////////////// template<> struct Multimethod::Traits { typedef Loki::TypeInfo index_type; static Loki::TypeInfo id(boost::any& target) { return Loki::TypeInfo(target.type()); }; template static Loki::TypeInfo id() { return Loki::TypeInfo(typeid(target_t)); }; template static type_t cast(boost::any& operand) { return boost::any_cast::type&>(operand); }; }; #endif