Skip to content

Commit

Permalink
Merge pull request #2041 from STEllAR-GROUP/fixing_2035
Browse files Browse the repository at this point in the history
Changing future_iterator_traits to support pointers
  • Loading branch information
hkaiser committed Mar 20, 2016
2 parents fbaf64b + 0bc357c commit a4fa2c0
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 1 deletion.
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

0 comments on commit a4fa2c0

Please sign in to comment.