From b442834bdc3cea85cde63e84136416e7abac5d27 Mon Sep 17 00:00:00 2001 From: Michael Uleysky Date: Tue, 29 Sep 2015 14:11:54 +1000 Subject: [PATCH] Make template Get available for modules. --- include/builtin.h | 11 ----------- include/common.h | 13 ++++++++++++- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/builtin.h b/include/builtin.h index 5e42a47..05a60e8 100644 --- a/include/builtin.h +++ b/include/builtin.h @@ -7,14 +7,3 @@ ObjectBase* Arifm_Div(const ObjectList* input); ObjectBase* Arifm_Pow(const ObjectList* input); ObjectBase* Arifm_Neg(const ObjectList* input); ObjectBase* Arifm_Pos(const ObjectList* input); - -template -ObjectBase* Get(const ObjectList* input) -{ - if(input->Size()!=2) return 0; - OBType ob(input->At(0)); - OBType name(input->At(1)); - if(!(ob && name)) return 0; - - return ob->Get(name->Value()); -} diff --git a/include/common.h b/include/common.h index 520096d..77b74f9 100644 --- a/include/common.h +++ b/include/common.h @@ -278,4 +278,15 @@ EXPORT void RegisterFunction(const std::string& name, Func func); EXPORT int LoadModule(const std::string& name, const void* p, const std::string& modname=""); } -#endif \ No newline at end of file +template +ObjectBase* Get(const ObjectList* input) +{ + if(input->Size()!=2) return 0; + OBType ob(input->At(0)); + OBType name(input->At(1)); + if(!(ob && name)) return 0; + + return ob->Get(name->Value()); +} + +#endif