diff --git a/.ycm_extra_conf.py b/.ycm_extra_conf.py index 12822c7b9..8b3b3c85a 100644 --- a/.ycm_extra_conf.py +++ b/.ycm_extra_conf.py @@ -13,7 +13,7 @@ BASE_FLAGS = [ '-fexceptions', '-ferror-limit=10000', '-DNDEBUG', - '-std=c++1y', + '-std=c++1z', '-xc++', '-I/usr/lib/', '-I/usr/include/', diff --git a/CMakeLists.txt b/CMakeLists.txt index 9aa973f67..07c43fbc3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,8 +38,9 @@ find_package(Threads REQUIRED) # ----------------------------------------------------------------------------- # c++14 +# TODO: set here 17 once it will be available in the cmake version (3.8) set(cxx_standard 14) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1z") # ----------------------------------------------------------------------------- # dir variables @@ -54,9 +55,9 @@ set(test_src_dir ${CMAKE_BINARY_DIR}/tests/src) # build flags ----------------------------------------------------------------- # release flags -set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG") +set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG -Wno-c++1z-extensions") #debug flags -set(CMAKE_CXX_FLAGS_DEBUG "-g") +set(CMAKE_CXX_FLAGS_DEBUG "-g -Wno-c++1z-extensions") # compiler specific flags if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") diff --git a/src/logging/streams/format.hpp b/src/logging/streams/format.hpp index 6f59deaf3..064c00427 100644 --- a/src/logging/streams/format.hpp +++ b/src/logging/streams/format.hpp @@ -5,15 +5,12 @@ #include "logging/log.hpp" -// TODO: in c++17 replace with logging::format -namespace logging { -namespace format { +namespace logging::format { +// TODO: read formats from the config static const std::string out = "{} {:<5} [{}] {}\n"; static const std::string err = out; - -// TODO: configurable formats } - +namespace logging { class Formatter { public: static std::string format(const std::string &format,