Get ChaiScript ported to MSVC 2013. See Notes in code.

This commit is contained in:
Jason Turner
2013-11-02 07:42:06 -06:00
parent 1708024372
commit 73b3762f7a
20 changed files with 166 additions and 70 deletions

View File

@@ -149,6 +149,12 @@ namespace chaiscript
namespace detail {
template<typename T>
size_t count(T &t_target, const typename T::key_type &t_key)
{
return t_target.count(t_key);
}
template<typename T>
void insert(T &t_target, const T &t_other)
{
@@ -405,11 +411,11 @@ namespace chaiscript
template<typename ContainerType>
ModulePtr unique_associative_container_type(const std::string &/*type*/, ModulePtr m = ModulePtr(new Module()))
{
m->add(fun<int (const ContainerType *, const typename ContainerType::key_type &)>(&ContainerType::count), "count");
m->add(fun(detail::count<ContainerType>), "count");
typedef size_t (ContainerType::*erase_ptr)(const typename ContainerType::key_type &);
m->add(fun<int (ContainerType *, const typename ContainerType::key_type &)>(static_cast<erase_ptr>(&ContainerType::erase)), "erase");
m->add(fun(static_cast<erase_ptr>(&ContainerType::erase)), "erase");
m->add(fun(&detail::insert<ContainerType>), "insert");