fix #25 warning

This commit is contained in:
2019-07-07 05:56:52 +07:00
parent 718f210adf
commit 6ef8cb676d
2 changed files with 29 additions and 21 deletions

View File

@@ -1270,11 +1270,12 @@ namespace promise_hpp
try {
auto context = std::make_shared<tuple_promise_context_t<
std::tuple_element_t<Is, ResultTuple>...>>();
std::make_tuple(make_tuple_sub_promise_impl<Is>(
auto promises = std::make_tuple(make_tuple_sub_promise_impl<Is>(
tuple,
resolver,
rejector,
context)...);
(void)promises;
} catch (...) {
result.reject(std::current_exception());
}

View File

@@ -3,18 +3,9 @@ cmake_minimum_required(VERSION 3.11 FATAL_ERROR)
project(promise.hpp.untests)
set(CATCH_BUILD_TESTING OFF CACHE BOOL "" FORCE)
include(FetchContent)
FetchContent_Declare(
catch2
GIT_REPOSITORY https://github.com/catchorg/catch2)
FetchContent_GetProperties(catch2)
if(NOT catch2_POPULATED)
FetchContent_Populate(catch2)
add_subdirectory(${catch2_SOURCE_DIR} ${catch2_BINARY_DIR})
endif()
#
# coverage
#
option(BUILD_WITH_COVERAGE "Build with coverage" OFF)
if(BUILD_WITH_COVERAGE AND (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang"))
@@ -24,16 +15,13 @@ if(BUILD_WITH_COVERAGE AND (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang"))
set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} ${COVERAGE_FLAGS}")
endif()
#
# executable
#
file(GLOB UNTESTS_SOURCES "*.cpp" "*.hpp")
add_executable(${PROJECT_NAME} ${UNTESTS_SOURCES})
target_link_libraries(${PROJECT_NAME}
Catch2
promise.hpp)
find_package(Threads REQUIRED)
target_link_libraries(${PROJECT_NAME}
Threads::Threads)
target_link_libraries(${PROJECT_NAME} promise.hpp)
target_compile_options(${PROJECT_NAME}
PRIVATE
@@ -44,3 +32,22 @@ target_compile_options(${PROJECT_NAME}
-Wall -Wextra -Wpedantic>)
add_test(${PROJECT_NAME} ${PROJECT_NAME})
#
# dependencies
#
find_package(Threads REQUIRED)
target_link_libraries(${PROJECT_NAME} Threads::Threads)
include(FetchContent)
FetchContent_Declare(
catch2
GIT_REPOSITORY https://github.com/catchorg/catch2)
FetchContent_GetProperties(catch2)
if(NOT catch2_POPULATED)
FetchContent_Populate(catch2)
target_include_directories(${PROJECT_NAME}
PRIVATE ${catch2_SOURCE_DIR}/single_include)
endif()