Skip to content

Commit

Permalink
Stop checking for c++11 support
Browse files Browse the repository at this point in the history
all Melodic targeted platforms use gnu++14 so checking and forcing -std=c++11 doesn't make sense anymore
  • Loading branch information
mikaelarguedas authored Feb 15, 2018
1 parent c7a99e0 commit a2f4cca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
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()

0 comments on commit a2f4cca

Please sign in to comment.