From f73e36a8d2f2cbc9c3242fa7c95f0e4996dbd6cc Mon Sep 17 00:00:00 2001 From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz> Date: Tue, 20 Jun 2017 23:21:48 +0200 Subject: [PATCH] switch to c++14 --- alib2common/src/debug/New.cpp | 4 ++++ alib2std/src/extensions/memory.hpp | 11 ----------- alib2std/src/extensions/utility.hpp | 23 ----------------------- makefile-binary | 2 +- makefile-library | 2 +- 5 files changed, 6 insertions(+), 36 deletions(-) diff --git a/alib2common/src/debug/New.cpp b/alib2common/src/debug/New.cpp index c23d74728c..3141e741e0 100644 --- a/alib2common/src/debug/New.cpp +++ b/alib2common/src/debug/New.cpp @@ -13,3 +13,7 @@ void * operator new( std::size_t n ) { void operator delete( void * ptr ) noexcept { operator delete( ptr, true ); } + +void operator delete( void * ptr, std::size_t ) noexcept { + operator delete( ptr, true ); +} diff --git a/alib2std/src/extensions/memory.hpp b/alib2std/src/extensions/memory.hpp index b1c609277e..7b3ad37004 100644 --- a/alib2std/src/extensions/memory.hpp +++ b/alib2std/src/extensions/memory.hpp @@ -419,17 +419,6 @@ struct compare < smart_ptr < T > > { }; - // TODO remove after switching to c++14 -template < typename T, typename ... Args > -std::unique_ptr < T > make_unique ( Args && ... args ) { - return std::unique_ptr < T > ( new T ( std::forward < Args > ( args ) ... ) ); -} - -template < typename T, typename ... Args > -std::smart_ptr < T > make_smart ( Args && ... args ) { - return std::smart_ptr < T > ( new T ( std::forward < Args > ( args ) ... ) ); -} - } /* namespace std */ #endif /* __MEMORY_HPP_ */ diff --git a/alib2std/src/extensions/utility.hpp b/alib2std/src/extensions/utility.hpp index 0b7e1198c2..b0cf827314 100644 --- a/alib2std/src/extensions/utility.hpp +++ b/alib2std/src/extensions/utility.hpp @@ -78,29 +78,6 @@ inline const T & make_const ( const T & ptr ) { return ptr; } - // TODO remove after switching to c++14 -template < size_t ... I > -struct index_sequence { - typedef index_sequence < I ... > type; -}; - -template < size_t N, size_t ... I > -struct make_index_sequence_helper : make_index_sequence_helper < N - 1, N - 1, I ... > { -}; - -template < size_t ... I > -struct make_index_sequence_helper < 0, I ... > { - typedef index_sequence < I ... > type; -}; - -template < size_t N > -struct make_index_sequence : make_index_sequence_helper < N >::type { -}; - -template < typename ... T > -struct index_sequence_for : make_index_sequence < sizeof ... ( T ) > { -}; - } /* namespace std */ #endif /* __UTILITY_HPP_ */ diff --git a/makefile-binary b/makefile-binary index 29d7008372..5d0382b699 100644 --- a/makefile-binary +++ b/makefile-binary @@ -57,7 +57,7 @@ FORCE: $${NEW_LINE}\ export NEW_LINE$${NEW_LINE}\ $${NEW_LINE}\ - CXXFLAGS:= -pipe -std=c++11 \$$(CXX_OTHER_FLAGS) -c $(CXX_FLAGS) -fPIC \$$(addprefix -I, \$$(realpath $(INCLUDE_PATHS)))$${NEW_LINE}\ + CXXFLAGS:= -pipe -std=c++14 \$$(CXX_OTHER_FLAGS) -c $(CXX_FLAGS) -fPIC \$$(addprefix -I, \$$(realpath $(INCLUDE_PATHS)))$${NEW_LINE}\ $${NEW_LINE}\ SOURCES:= \$$(shell find \$$(SOURCES_BASE_DIR)/\$$(SRCDIR) -maxdepth 1 -type f -name \"*.cpp\")$${NEW_LINE}\ DEPENDENCIES:= \$$(patsubst \$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%.cpp, \$$(OBJECTS_BASE_DIR)/\$$(SRCDIR)%.d, \$$(SOURCES))$${NEW_LINE}\ diff --git a/makefile-library b/makefile-library index 481a9469f6..d7837275b4 100644 --- a/makefile-library +++ b/makefile-library @@ -64,7 +64,7 @@ FORCE: $${NEW_LINE}\ export NEW_LINE$${NEW_LINE}\ $${NEW_LINE}\ - CXXFLAGS:= -pipe -std=c++11 \$$(CXX_OTHER_FLAGS) -c $(CXX_FLAGS) -fPIC \$$(addprefix -I, \$$(realpath $(INCLUDE_PATHS))) -I\$$(realpath \$$(SOURCES_BASE_DIR)/../src/)$${NEW_LINE}\ + CXXFLAGS:= -pipe -std=c++14 \$$(CXX_OTHER_FLAGS) -c $(CXX_FLAGS) -fPIC \$$(addprefix -I, \$$(realpath $(INCLUDE_PATHS))) -I\$$(realpath \$$(SOURCES_BASE_DIR)/../src/)$${NEW_LINE}\ $${NEW_LINE}\ SOURCES:= \$$(shell find \$$(SOURCES_BASE_DIR)/\$$(SRCDIR) -maxdepth 1 -type f -name \"*.cpp\")$${NEW_LINE}\ DEPENDENCIES:= \$$(patsubst \$$(SOURCES_BASE_DIR)/\$$(SRCDIR)%.cpp, \$$(OBJECTS_BASE_DIR)/\$$(SRCDIR)%.d, \$$(SOURCES))$${NEW_LINE}\ -- GitLab