Skip to content
Snippets Groups Projects
Commit 2c1978ad authored by pre-commit-ci[bot]'s avatar pre-commit-ci[bot]
Browse files

[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
parent 63ccfabe
No related branches found
No related tags found
No related merge requests found
...@@ -26,8 +26,8 @@ struct expected_pytype_for_arg<boost::optional<T> > ...@@ -26,8 +26,8 @@ struct expected_pytype_for_arg<boost::optional<T> >
#ifdef EIGENPY_WITH_CXX17_SUPPORT #ifdef EIGENPY_WITH_CXX17_SUPPORT
template <typename T> template <typename T>
struct expected_pytype_for_arg<std::optional<T> > struct expected_pytype_for_arg<std::optional<T> > : expected_pytype_for_arg<T> {
: expected_pytype_for_arg<T> {}; };
#endif #endif
} // namespace converter } // namespace converter
...@@ -37,18 +37,19 @@ struct expected_pytype_for_arg<std::optional<T> > ...@@ -37,18 +37,19 @@ struct expected_pytype_for_arg<std::optional<T> >
namespace eigenpy { namespace eigenpy {
namespace detail { namespace detail {
/// Helper struct to decide which type is the "none" type for a specific optional<T> implementation. /// Helper struct to decide which type is the "none" type for a specific
template<template <typename> class OptionalTpl> /// optional<T> implementation.
template <template <typename> class OptionalTpl>
struct nullopt_helper {}; struct nullopt_helper {};
template<> template <>
struct nullopt_helper<boost::optional> { struct nullopt_helper<boost::optional> {
typedef boost::none_t type; typedef boost::none_t type;
static type value() { return boost::none; } static type value() { return boost::none; }
}; };
#ifdef EIGENPY_WITH_CXX17_SUPPORT #ifdef EIGENPY_WITH_CXX17_SUPPORT
template<> template <>
struct nullopt_helper<std::optional> { struct nullopt_helper<std::optional> {
typedef std::nullopt_t type; typedef std::nullopt_t type;
static type value() { return std::nullopt; } static type value() { return std::nullopt; }
......
...@@ -46,9 +46,13 @@ function(config_bind_optional tagname opttype) ...@@ -46,9 +46,13 @@ function(config_bind_optional tagname opttype)
configure_file(bind_optional.cpp.in ${MODNAME}.cpp) configure_file(bind_optional.cpp.in ${MODNAME}.cpp)
set(py_file test_optional_${tagname}.py) set(py_file test_optional_${tagname}.py)
configure_file(python/test_optional.py.in ${CMAKE_CURRENT_SOURCE_DIR}/python/${py_file}) configure_file(python/test_optional.py.in
${CMAKE_CURRENT_SOURCE_DIR}/python/${py_file})
add_lib_unit_test(${MODNAME}) add_lib_unit_test(${MODNAME})
message(STATUS "Adding unit test py-optional-${tagname} with file ${py_file} and module ${MODNAME}") message(
STATUS
"Adding unit test py-optional-${tagname} with file ${py_file} and module ${MODNAME}"
)
add_python_unit_test("py-optional-${tagname}" "unittest/python/${py_file}" add_python_unit_test("py-optional-${tagname}" "unittest/python/${py_file}"
"unittest") "unittest")
endfunction() endfunction()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment