diff --git a/include/chaiscript/dispatchkit/bootstrap.hpp b/include/chaiscript/dispatchkit/bootstrap.hpp index 97338bd..426263e 100644 --- a/include/chaiscript/dispatchkit/bootstrap.hpp +++ b/include/chaiscript/dispatchkit/bootstrap.hpp @@ -93,27 +93,34 @@ namespace chaiscript /** - * to_string function for internal use. Uses ostream operator<< - */ + * to_string function for internal use. Uses ostream operator<< + */ template - std::string to_string(Input i) - { - return boost::lexical_cast(i); - } - + std::string to_string(Input i) + { + std::stringstream ss; + ss << i; + return ss.str(); + } /** - * Internal function for converting from a string to a value - * uses ostream operator >> to perform the conversion - */ + * Internal function for converting from a string to a value + * uses ostream operator >> to perform the conversion + */ template - Input parse_string(const std::string &i) - { - return boost::lexical_cast(i); - } + Input parse_string(const std::string &i) + { + std::stringstream ss(i); + Input t; + ss >> t; + return t; + } + + + /** * Add all common functions for a POD type. All operators, and * common conversions diff --git a/include/chaiscript/dispatchkit/dispatchkit.hpp b/include/chaiscript/dispatchkit/dispatchkit.hpp index 2698683..a805233 100644 --- a/include/chaiscript/dispatchkit/dispatchkit.hpp +++ b/include/chaiscript/dispatchkit/dispatchkit.hpp @@ -12,8 +12,6 @@ #include #include #include -#include -#include #include #include #include diff --git a/include/chaiscript/dispatchkit/proxy_functions_detail.hpp b/include/chaiscript/dispatchkit/proxy_functions_detail.hpp index c266827..f364cc6 100644 --- a/include/chaiscript/dispatchkit/proxy_functions_detail.hpp +++ b/include/chaiscript/dispatchkit/proxy_functions_detail.hpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include diff --git a/samples/example.cpp b/samples/example.cpp index 47e2639..ff670e7 100644 --- a/samples/example.cpp +++ b/samples/example.cpp @@ -141,7 +141,9 @@ int main(int /*argc*/, char * /*argv*/[]) { //Creating a functor on the stack and using it immediatly int x = chai.eval >("fun (x, y) { return x + y; }")(5, 6); - log("Functor test output", boost::lexical_cast(x)); + std::stringstream ss; + ss << x; + log("Functor test output", ss.str()); chai.add(var(boost::shared_ptr()), "nullvar"); chai("print(\"This should be true.\"); print(nullvar.is_var_null())"); diff --git a/src/multithreaded.cpp b/src/multithreaded.cpp index 52c9fbe..595511f 100644 --- a/src/multithreaded.cpp +++ b/src/multithreaded.cpp @@ -14,8 +14,10 @@ void do_work(chaiscript::ChaiScript &c) { // c("use(\"work.chai\"); do_chai_work(num_iterations);"); - std::string name = "MyVar" + boost::lexical_cast(rand()); - c.add(chaiscript::var(5), name); + + std::stringstream ss; + ss << "MyVar" << rand(); + c.add(chaiscript::var(5), ss.str()); c("use(\"work.chai\"); do_chai_work(10000);"); }