Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop checking for c++11 support #87

Merged
merged 1 commit into from
Feb 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions include/class_loader/class_loader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
#include <boost/shared_ptr.hpp>
#include <boost/thread/recursive_mutex.hpp>
#include <cstddef>
#include <functional>
#include <memory>
#include <string>
#include <vector>

Expand All @@ -44,11 +46,6 @@
#include "class_loader/class_loader_core.hpp"
#include "class_loader/register_macro.hpp"

#if __cplusplus >= 201103L
#include <memory>
#include <functional>
#endif

namespace class_loader
{

Expand Down Expand Up @@ -77,13 +74,11 @@ std::string systemLibraryFormat(const std::string & library_name);
class ClassLoader
{
public:
#if __cplusplus >= 201103L
template<typename Base>
using DeleterType = std::function<void(Base *)>;

template<typename Base>
using UniquePtr = std::unique_ptr<Base, DeleterType<Base>>;
#endif

/**
* @brief Constructor for ClassLoader
Expand Down Expand Up @@ -129,7 +124,6 @@ class ClassLoader
boost::bind(&ClassLoader::onPluginDeletion<Base>, this, _1));
}

#if __cplusplus >= 201103L
/**
* @brief Generates an instance of loadable classes (i.e. class_loader).
*
Expand All @@ -150,7 +144,6 @@ class ClassLoader
raw,
boost::bind(&ClassLoader::onPluginDeletion<Base>, this, _1));
}
#endif

/**
* @brief Generates an instance of loadable classes (i.e. class_loader).
Expand Down
2 changes: 0 additions & 2 deletions include/class_loader/multi_library_class_loader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ class MultiLibraryClassLoader
return loader->createInstance<Base>(class_name);
}

#if __cplusplus >= 201103L
/**
* @brief Creates an instance of an object of given class name with ancestor class Base
* This version does not look in a specific library for the factory, but rather the first open library that defines the classs
Expand Down Expand Up @@ -160,7 +159,6 @@ class MultiLibraryClassLoader
}
return loader->createUniqueInstance<Base>(class_name);
}
#endif

/**
* @brief Creates an instance of an object of given class name with ancestor class Base
Expand Down
13 changes: 4 additions & 9 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,8 @@ if(TARGET ${PROJECT_NAME}_utest)
add_dependencies(${PROJECT_NAME}_utest ${PROJECT_NAME}_TestPlugins1 ${PROJECT_NAME}_TestPlugins2)
endif()

include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-std=c++11" COMPILER_SUPPORTS_CXX11)
if(COMPILER_SUPPORTS_CXX11)
catkin_add_gtest(${PROJECT_NAME}_unique_ptr_test unique_ptr_test.cpp)
if(TARGET ${PROJECT_NAME}_unique_ptr_test)
target_link_libraries(${PROJECT_NAME}_unique_ptr_test ${Boost_LIBRARIES} ${class_loader_LIBRARIES})
set_target_properties(${PROJECT_NAME}_unique_ptr_test PROPERTIES COMPILE_FLAGS -std=c++11 LINK_FLAGS -std=c++11)
add_dependencies(${PROJECT_NAME}_unique_ptr_test ${PROJECT_NAME}_TestPlugins1 ${PROJECT_NAME}_TestPlugins2)
endif()
catkin_add_gtest(${PROJECT_NAME}_unique_ptr_test unique_ptr_test.cpp)
if(TARGET ${PROJECT_NAME}_unique_ptr_test)
target_link_libraries(${PROJECT_NAME}_unique_ptr_test ${Boost_LIBRARIES} ${class_loader_LIBRARIES})
add_dependencies(${PROJECT_NAME}_unique_ptr_test ${PROJECT_NAME}_TestPlugins1 ${PROJECT_NAME}_TestPlugins2)
endif()