Skip to content

Commit

Permalink
fix std compile failed. add check on classic gcc 4.8.5.
Browse files Browse the repository at this point in the history
  • Loading branch information
levalup committed Jul 1, 2024
1 parent d0331ac commit 0440500
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/build-classic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
gcc_version: [ '4.8.5' ]
cmake_version: [ '3.9.6' ]
build_type: [ Release ]
include:
- gcc_version: '4.8.5'
libuv_version: '1.44.2'

name: "In Container GCC ${{matrix.gcc_version}} ${{matrix.build_type}}"

Expand Down Expand Up @@ -57,6 +60,12 @@ jobs:
gcc --version
g++ --version
- name: Checkout libuv
run: |
cd libuv
git checkout "v${{matrix.libuv_version}}"
cd ..
- name: Configure
run: |
mkdir -p build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-msvc-std.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ jobs:
- name: Configure
run: >
cmake -B "${{ steps.strings.outputs.build-output-dir }}"
-DCMAKE_CXX_COMPILER=${{ matrix.cl }}
-DCMAKE_C_COMPILER=${{ matrix.cl }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DSTD=${{ matrix.std }}
-S "${{ github.workspace }}"
- name: Build
run: >-
cmake --build "${{ steps.strings.outputs.build-output-dir }}"
-DCMAKE_CXX_COMPILER=${{ matrix.cl }}
-DCMAKE_C_COMPILER=${{ matrix.cl }}
--config ${{ matrix.build_type }}
- name: Test
Expand Down
14 changes: 8 additions & 6 deletions include/uvcxx/utils/apply.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@

namespace uvcxx {
#if UVCXX_STD_APPLY
template <typename F, typename T>

template<typename F, typename T>
inline decltype(auto) proxy_apply(F &&f, T &&t) {
return std::apply(std::forward<F>(f), std::forward<T>(t));
}

#else
namespace inner {
template<typename F, typename Tuple>
Expand All @@ -26,11 +28,6 @@ namespace uvcxx {
public:
using Ret = decltype(std::declval<FUNC>()(std::declval<Args>()...));

template<typename F, typename T>
Ret operator()(F &&f, T &&t) {
return apply<sizeof...(Args)>(std::forward<F>(f), std::forward<T>(t));
}

template<size_t I, typename F, typename T, typename std::enable_if<I == 0, int>::type = 0>
Ret apply(F &&f, T &&) {
return f();
Expand Down Expand Up @@ -130,6 +127,11 @@ namespace uvcxx {
std::get<8>(std::forward<T>(t)),
std::get<9>(std::forward<T>(t)));
}

template<typename F, typename T>
Ret operator()(F &&f, T &&t) {
return this->apply<sizeof...(Args)>(std::forward<F>(f), std::forward<T>(t));
}
};
}

Expand Down

0 comments on commit 0440500

Please sign in to comment.