10 #ifndef CHAISCRIPT_FUNCTION_PARAMS_HPP 11 #define CHAISCRIPT_FUNCTION_PARAMS_HPP 13 #include "boxed_value.hpp" 25 , m_end(m_begin + 1) {
28 explicit Function_Params(
const std::vector<Boxed_Value> &vec)
29 : m_begin(vec.empty() ? nullptr : &vec.front())
30 , m_end(vec.empty() ? nullptr : &vec.front() + vec.size()) {
34 constexpr
explicit Function_Params(
const std::array<Boxed_Value, Size> &a)
36 , m_end(&a.front() + Size) {
39 [[nodiscard]] constexpr
const Boxed_Value &operator[](
const std::size_t t_i)
const noexcept {
return m_begin[t_i]; }
41 [[nodiscard]] constexpr
const Boxed_Value *begin()
const noexcept {
return m_begin; }
43 [[nodiscard]] constexpr
const Boxed_Value &front()
const noexcept {
return *m_begin; }
45 [[nodiscard]] constexpr
const Boxed_Value *end()
const noexcept {
return m_end; }
47 [[nodiscard]] constexpr std::size_t size()
const noexcept {
return std::size_t(m_end - m_begin); }
49 [[nodiscard]] std::vector<Boxed_Value> to_vector()
const {
return std::vector<Boxed_Value>{m_begin, m_end}; }
51 [[nodiscard]] constexpr
bool empty()
const noexcept {
return m_begin == m_end; }
60 constexpr Function_Params::Function_Params(
const std::array<
Boxed_Value,
size_t{0}> & )
Namespace chaiscript contains every API call that the average user will be concerned with...
Definition: function_params.hpp:16
A wrapper for holding any valid C++ type.
Definition: boxed_value.hpp:24