//------------------------------------------------------------------------------------------------- Value Function::call(const UserObject& object, const Args& args) const { // Check if the function is callable if (!callable(object)) CAMP_ERROR(ForbiddenCall(name())); // Check the number of arguments if (args.count() < m_argTypes.size()) CAMP_ERROR(NotEnoughArguments(name(), args.count(), m_argTypes.size())); // Execute the function return execute(object, args); }
/** * \see Constructor::matches */ virtual bool matches(const Args& args) const { return (args.count() == 3) && checkArg<A0>(args[0]) && checkArg<A1>(args[1]) && checkArg<A2>(args[2]); }
/** * \see Constructor::matches */ virtual bool matches(const Args& args) const override { return args.count() == sizeof...(A) && checkArgs<A...>(args, make_index_sequence<sizeof...(A)>()); }
/** * \see Constructor::matches */ virtual bool matches(const Args& args) const { return (args.count() == 0); }
/** * \see Constructor::matches */ virtual bool matches(const Args& args) const { return (args.count() == 1) && checkArg<A0>(args[0]); }