Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing future_iterator_traits to support pointers #2041

Merged
merged 3 commits into from
Mar 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion hpx/lcos/future.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ namespace hpx { namespace lcos { namespace detail
template <typename Iterator>
struct future_iterator_traits<Iterator,
typename hpx::util::always_void<
typename Iterator::iterator_category
typename std::iterator_traits<Iterator>::value_type
>::type>
{
typedef
Expand Down
31 changes: 31 additions & 0 deletions tests/regressions/lcos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,34 @@ add_hpx_test(
EXECUTABLE after_588
LOCALITIES 2
THREADS_PER_LOCALITY 4)

# compile only tests
set(compile_tests
wait_all_std_array_2035
)

foreach(compile_test ${compile_tests})
set(sources
${compile_test}.cpp)

source_group("Source Files" FILES ${sources})

add_hpx_unit_compile_test(
"lcos_regressions"
${compile_test}
SOURCES ${sources}
${${compile_test}_FLAGS}
FOLDER "Tests/Regressions/LCOs/CompileOnly")

# add a custom target for this example
add_hpx_pseudo_target(tests.regressions.lcos_dir.${compile_test})

# make pseudo-targets depend on master pseudo-target
add_hpx_pseudo_dependencies(tests.regressions.lcos_dir
tests.regressions.lcos_dir.${compile_test})

# add dependencies to pseudo-target
add_hpx_pseudo_dependencies(tests.regressions.lcos_dir.${compile_test}
"tests.regressions.lcos_dir.${compile_test}")

endforeach()
26 changes: 26 additions & 0 deletions tests/regressions/lcos/wait_all_std_array_2035.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright (c) 2016 Hadrian G. (a.k.a. Neolander)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

// This compile-only test case verifies that #2035 remains fixed

#include <hpx/config.hpp>

#if defined(HPX_HAVE_CXX11_STD_ARRAY)
#include <hpx/hpx_main.hpp>
#include <hpx/include/future.hpp>
#include <hpx/lcos/wait_all.hpp>

#include <array>

int main()
{
std::array<hpx::shared_future<int>, 1> future_array
{{ hpx::make_ready_future(0) }};

hpx::wait_all(future_array.cbegin(), future_array.cend());

return 0;
}
#endif