EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ReferenceWrapperAnyCompat.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ReferenceWrapperAnyCompat.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2020 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
10 
11 // This workround does not work on libc++. To detect libc++, we include
12 // one STL header and then check if _LIBCPP_VERSION is defined.
13 
14 #include <any>
15 #include <type_traits>
16 
17 // only if clang and libstdc++
18 #if !defined(_LIBCPP_VERSION) && defined(__clang__)
19 
20 // Workaround for building on clang+libstdc++
21 // See https://gitlab.cern.ch/atlas/atlasexternals/merge_requests/563
22 namespace std {
23 template <>
24 struct is_constructible<std::reference_wrapper<const std::any>,
25  const std::reference_wrapper<const std::any>&>
26  : public true_type {};
27 template <>
28 struct is_constructible<std::reference_wrapper<const std::any>,
29  std::reference_wrapper<const std::any>&>
30  : public true_type {};
31 template <>
32 struct is_copy_constructible<std::reference_wrapper<const std::any>>
33  : public true_type {};
34 } // namespace std
35 
36 #endif