Create a bound function object. The first param is the function to bind the remaining parameters are the args to bind into the result
| 254 | /// Create a bound function object. The first param is the function to bind |
| 255 | /// the remaining parameters are the args to bind into the result |
| 256 | static Boxed_Value bind_function(const std::vector<Boxed_Value> ¶ms) |
| 257 | { |
| 258 | if (params.empty()) { |
| 259 | throw exception::arity_error(0, 1); |
| 260 | } |
| 261 | |
| 262 | Const_Proxy_Function f = boxed_cast<Const_Proxy_Function>(params[0]); |
| 263 | |
| 264 | if (f->get_arity() != -1 && size_t(f->get_arity()) != params.size() - 1) |
| 265 | { |
| 266 | throw exception::arity_error(static_cast<int>(params.size()), f->get_arity()); |
| 267 | } |
| 268 | |
| 269 | return Boxed_Value(Const_Proxy_Function(std::make_shared<dispatch::Bound_Function>(std::move(f), |
| 270 | std::vector<Boxed_Value>(params.begin() + 1, params.end())))); |
| 271 | } |
| 272 | |
| 273 | |
| 274 | static bool has_guard(const Const_Proxy_Function &t_pf) |
nothing calls this directly
no test coverage detected