1 //  Copyright (c) 2017 Hartmut Kaiser
2 //
3 //  Distributed under the Boost Software License, Version 1.0. (See accompanying
4 //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 
6 #include <hpx/hpx_main.hpp>
7 #include <hpx/include/components.hpp>
8 #include <hpx/util/lightweight_test.hpp>
9 
10 #include <vector>
11 
12 ///////////////////////////////////////////////////////////////////////////////
13 struct test_server : hpx::components::component_base<test_server>
14 {
test_servertest_server15     test_server(int) {}
16 };
17 
18 typedef hpx::components::component<test_server> server_type;
19 HPX_REGISTER_COMPONENT(server_type, test_server);
20 
test_bulk_new()21 void test_bulk_new()
22 {
23     auto locs = hpx::find_all_localities();
24 
25     std::vector<hpx::id_type> ids =
26         hpx::new_<test_server[]>(hpx::default_layout(locs), 10, 42).get();
27 
28     hpx::future<std::vector<hpx::id_type>> ids_f =
29         hpx::new_<test_server[]>(hpx::default_layout(locs), 10, 42);
30 }
31 
32 ///////////////////////////////////////////////////////////////////////////////
main()33 int main()
34 {
35     test_bulk_new();
36 
37     return 0;
38 }
39 
40