X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/992c3a8621f205aedc022a0d5a5d3fc7bb75e6a1..a7cc502f224afb96f0203b94759cd0dabebf8de5:/include/xbt/functional.hpp diff --git a/include/xbt/functional.hpp b/include/xbt/functional.hpp index 9509d49aa8..9d1b337c49 100644 --- a/include/xbt/functional.hpp +++ b/include/xbt/functional.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2015-2022. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2015-2023. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -23,8 +23,7 @@ #include #include -namespace simgrid { -namespace xbt { +namespace simgrid::xbt { template class MainFunction { F code_; @@ -74,12 +73,12 @@ constexpr auto apply(F&& f, Tuple&& t, std::index_sequence) * @endcode **/ template -constexpr auto apply(F&& f, Tuple&& t) -> decltype( - simgrid::xbt::bits::apply(std::forward(f), std::forward(t), - std::make_index_sequence>::value>())) +constexpr auto apply(F&& f, Tuple&& t) + -> decltype(simgrid::xbt::bits::apply(std::forward(f), std::forward(t), + std::make_index_sequence>>())) { return simgrid::xbt::bits::apply(std::forward(f), std::forward(t), - std::make_index_sequence>::value>()); + std::make_index_sequence>>()); } template class Task; @@ -179,7 +178,7 @@ private: return code(std::forward(args)...); }, // Destroy: - std::is_trivially_destructible::value ? + std::is_trivially_destructible_v ? static_cast(nullptr) : [](TaskUnion& buffer) { auto* code = reinterpret_cast(&buffer); @@ -260,6 +259,5 @@ template auto make_task(F code, Args... args) -> Task(std::move(task)); } -} // namespace xbt -} // namespace simgrid +} // namespace simgrid::xbt #endif