About 3,490 results
Open links in new tab
  1. std::function - cppreference.cn - C++参考手册

    存储的可调用对象称为 std::function 的 目标。 如果 std::function 不包含目标,则称其为 空的。 调用 空的 std::function 的 目标 会导致抛出 std::bad_function_call 异常。 std::function 满足 可复制构 …

  2. 函数 - cppreference.cn - C++参考手册

    标准库还提供了许多预定义的 函数对象模板 以及组合新模板的方法(包括 std::less 、 std::mem_fn 、 std::bind 、 std::function (C++11 起)、 std::not_fn (C++17 起)、 std::bind_front (C++20 起) …

  3. cppreference.cn - C++参考手册

    新闻 2019 年 6 月 7 日: 离线存档 新版本 2018 年 10 月 28 日: 离线存档 新版本 2018 年 3 月 11 日: 离线存档 新版本

  4. 标准库头文件 <functional> - cppreference.cn - C++参考手册

    ArgTypes> class copyable_function <R (ArgTypes...) /*cv ref*/ noexcept(/*noex*/)>; // non-owning wrapper template<class...> class function_ref; // not defined template<class R, class...

  5. std::function<R (Args...)>::function - cppreference.cn - C++参考手册

    当目标是函数指针或 std::reference_wrapper 时,保证进行小对象优化,即这些目标始终直接存储在 std::function 对象内部,不发生动态分配。 其他大型对象可能会在动态分配的存储中构造,并通过 …

  6. 函数 - cppreference.cn - C++参考手册

    // function definition. // defines a function with the name "sum" and with the body "{ return x+y; }" int sum (int x, int y) { return x + y; }

  7. 函数声明 - cppreference.cn - C++参考手册

    void f (const int n) // declares function of type void(int) { // but in the body, the type of “n” is const int }

  8. 函数模板 - cppreference.cn - C++参考手册

    f <const int>(1); // function type is void(int), t is const int // two different functions with the same type and the same x // (pointers to these two functions are not equal, // and function-local statics would have …

  9. 函数契约说明符 (C++26 起) - cppreference.cn - C++参考手册

    函数契约说明符(前置条件以 pre 表示,后置条件以 post 表示)是可以应用于函数或 lambda 表达式的声明符的说明符,用于向相应的函数引入相应类型的函数契约断言。 它们确保指定的条件在执行期间 …

  10. 主函数 - cppreference.cn - C++参考手册

    argc 和 argv 的名称是任意的,参数类型的表示也是任意的: int main(int ac, char** av) 同样有效。