drop useless statics and/or add [[nodiscard]]

This commit is contained in:
Bernd Amend 2021-05-22 13:50:57 +02:00
parent 1235fdad7c
commit e62f0d3296
3 changed files with 3 additions and 6 deletions

View File

@ -281,7 +281,7 @@ namespace chaiscript {
static inline std::vector<Options> default_options() [[nodiscard]] inline std::vector<Options> default_options()
{ {
#ifdef CHAISCRIPT_NO_DYNLOAD #ifdef CHAISCRIPT_NO_DYNLOAD
return {Options::No_Load_Modules, Options::External_Scripts}; return {Options::No_Load_Modules, Options::External_Scripts};

View File

@ -60,7 +60,7 @@ namespace chaiscript {
return m_end - m_begin; return m_end - m_begin;
} }
std::vector<Boxed_Value> to_vector() const { [[nodiscard]] std::vector<Boxed_Value> to_vector() const {
return std::vector<Boxed_Value>{m_begin, m_end}; return std::vector<Boxed_Value>{m_begin, m_end};
} }
@ -71,7 +71,6 @@ namespace chaiscript {
private: private:
const Boxed_Value *m_begin = nullptr; const Boxed_Value *m_begin = nullptr;
const Boxed_Value *m_end = nullptr; const Boxed_Value *m_end = nullptr;
}; };
// Constructor specialization for array of size 0 // Constructor specialization for array of size 0
@ -83,6 +82,4 @@ namespace chaiscript {
} }
#endif #endif

View File

@ -51,7 +51,7 @@ namespace chaiscript
{ {
/// Helper function that will set up the scope around a function call, including handling the named function parameters /// Helper function that will set up the scope around a function call, including handling the named function parameters
template<typename T> template<typename T>
static Boxed_Value eval_function(chaiscript::detail::Dispatch_Engine &t_ss, const AST_Node_Impl<T> &t_node, const std::vector<std::string> &t_param_names, const Function_Params &t_vals, const std::map<std::string, Boxed_Value> *t_locals=nullptr, bool has_this_capture = false) { Boxed_Value eval_function(chaiscript::detail::Dispatch_Engine &t_ss, const AST_Node_Impl<T> &t_node, const std::vector<std::string> &t_param_names, const Function_Params &t_vals, const std::map<std::string, Boxed_Value> *t_locals=nullptr, bool has_this_capture = false) {
chaiscript::detail::Dispatch_State state(t_ss); chaiscript::detail::Dispatch_State state(t_ss);
const Boxed_Value *thisobj = [&]() -> const Boxed_Value *{ const Boxed_Value *thisobj = [&]() -> const Boxed_Value *{