diff --git a/reference/functional/move_only_function/op_constructor.md b/reference/functional/move_only_function/op_constructor.md index d5bd1e25b1..338da0c7b1 100644 --- a/reference/functional/move_only_function/op_constructor.md +++ b/reference/functional/move_only_function/op_constructor.md @@ -137,21 +137,21 @@ int main() // (4) 関数ポインタを受け取って構築 { - std::function f = ident_func; + std::move_only_function f = ident_func; int result = f(1); std::cout << "(4) function pointer : " << result << std::endl; } // (4) 関数オブジェクトを受け取って構築 { - std::function f = ident_functor(); + std::move_only_function f = ident_functor(); int result = f(1); std::cout << "(4) function object : " << result << std::endl; } // (4) メンバ関数ポインタを受け取った構築 { - std::function f = &X::add_member_func; + std::move_only_function f = &X::add_member_func; X x{2}; int result = f(x, 1); @@ -159,7 +159,7 @@ int main() } // (4) メンバ変数ポインタを受け取った構築 { - std::function f = &X::value; + std::move_only_function f = &X::value; X x{2}; int result = f(x); std::cout << "(4) member variable pointer : " << result << std::endl;