diff options
author | Chad Austin <chad@imvu.com> | 2013-04-18 16:52:42 -0700 |
---|---|---|
committer | Chad Austin <chad@imvu.com> | 2013-05-02 18:54:27 -0700 |
commit | 6566a0c989b101572c8154bbd43cc6a07532bada (patch) | |
tree | 1618603630cee4ba36764c7165478e106389351c /system | |
parent | 0fb5e1babc151af00b94c61c3cc5a080d3053d1f (diff) |
Add a select_const for selecting the const method implementation if there are only two.
Conflicts:
tests/embind/embind_test.cpp
Diffstat (limited to 'system')
-rwxr-xr-x | system/include/emscripten/bind.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/system/include/emscripten/bind.h b/system/include/emscripten/bind.h index 4d2f4ac8..d5b2fe6a 100755 --- a/system/include/emscripten/bind.h +++ b/system/include/emscripten/bind.h @@ -224,6 +224,10 @@ namespace emscripten { struct allow_raw_pointer : public allow_raw_pointers { }; + //////////////////////////////////////////////////////////////////////////////// + // select_overload and select_const + //////////////////////////////////////////////////////////////////////////////// + template<typename Signature> typename std::add_pointer<Signature>::type select_overload(typename std::add_pointer<Signature>::type fn) { return fn; @@ -241,6 +245,15 @@ namespace emscripten { return fn; } + template<typename ClassType, typename ReturnType, typename... Args> + auto select_const(ReturnType (ClassType::*method)(Args...) const) -> decltype(method) { + return method; + } + + //////////////////////////////////////////////////////////////////////////////// + // Invoker + //////////////////////////////////////////////////////////////////////////////// + namespace internal { template<typename ReturnType, typename... Args> struct Invoker { |