MCPcopy Create free account
hub / github.com/pybind/pybind11 / take

Method take

tests/test_methods_and_attributes.cpp:198–200  ·  view source on GitHub ↗

Exercises cpp_function(Return (Class::*)(Args...) &&, ...). Moves m_payload to verify that std::move(*c).*f is used in the lambda body.

Source from the content-addressed store, hash-verified

196 // Exercises cpp_function(Return (Class::*)(Args...) &&, ...).
197 // Moves m_payload to verify that std::move(*c).*f is used in the lambda body.
198 std::string take() && { // NOLINT(readability-make-member-function-const)
199 return std::move(m_payload);
200 }
201 // Exercises cpp_function(Return (Class::*)(Args...) const &&, ...)
202 int peek() const && { return m_value; }
203#ifdef __cpp_noexcept_function_type

Callers 1

Calls 1

moveFunction · 0.85

Tested by

no test coverage detected