test_future_internal.h 807 B

12345678910111213141516171819202122232425262728
  1. // Copyright 2021 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef BASE_TEST_TEST_FUTURE_INTERNAL_H_
  5. #define BASE_TEST_TEST_FUTURE_INTERNAL_H_
  6. namespace base {
  7. namespace test {
  8. namespace internal {
  9. // Helper to only implement a method if the future holds a single value
  10. template <typename Tuple>
  11. using EnableIfSingleValue =
  12. std::enable_if_t<(std::tuple_size<Tuple>::value <= 1), bool>;
  13. // Helper to only implement a method if the future holds multiple values
  14. template <typename Tuple>
  15. using EnableIfMultiValue =
  16. std::enable_if_t<(std::tuple_size<Tuple>::value > 1), bool>;
  17. } // namespace internal
  18. } // namespace test
  19. } // namespace base
  20. #endif // BASE_TEST_TEST_FUTURE_INTERNAL_H_