mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-06 16:56:45 +08:00
try compatible with old compilers
This commit is contained in:
parent
5ecbe21bc8
commit
99692221b7
@ -2,7 +2,7 @@ TEMPLATE = lib
|
|||||||
TARGET = ipc
|
TARGET = ipc
|
||||||
|
|
||||||
CONFIG -= qt
|
CONFIG -= qt
|
||||||
CONFIG += c++14 c++1z
|
CONFIG += c++14 c++17 c++1z
|
||||||
|
|
||||||
!msvc:QMAKE_CXXFLAGS += -Wno-attributes -Wno-missing-field-initializers -Wno-unused-variable
|
!msvc:QMAKE_CXXFLAGS += -Wno-attributes -Wno-missing-field-initializers -Wno-unused-variable
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ QT += core testlib
|
|||||||
QT -= gui
|
QT -= gui
|
||||||
|
|
||||||
CONFIG += console
|
CONFIG += console
|
||||||
CONFIG += c++14 c++1z
|
CONFIG += c++14 c++17 c++1z
|
||||||
CONFIG -= app_bundle
|
CONFIG -= app_bundle
|
||||||
|
|
||||||
DESTDIR = ../output
|
DESTDIR = ../output
|
||||||
|
|||||||
@ -27,7 +27,11 @@ constexpr decltype(auto) static_switch(std::size_t i, std::index_sequence<N, I..
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename F, std::size_t...I>
|
template <typename F, std::size_t...I>
|
||||||
|
#if __cplusplus >= 201703L
|
||||||
constexpr void static_for(std::index_sequence<I...>, F&& f) {
|
constexpr void static_for(std::index_sequence<I...>, F&& f) {
|
||||||
|
#else /*__cplusplus < 201703L*/
|
||||||
|
inline void static_for(std::index_sequence<I...>, F&& f) {
|
||||||
|
#endif/*__cplusplus < 201703L*/
|
||||||
[[maybe_unused]] auto expand = { (f(std::integral_constant<size_t, I>{}), 0)... };
|
[[maybe_unused]] auto expand = { (f(std::integral_constant<size_t, I>{}), 0)... };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user