Skip to content
Snippets Groups Projects
Commit c2436d4f authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'concepts.CxxUtils-20200503' into 'master'

CxxUtils: Add a helper to start playing with C++20 concepts.

See merge request atlas/athena!32579
parents f73e511e b8a9c1b1
No related branches found
No related tags found
No related merge requests found
// This file's extension implies that it's C, but it's really -*- C++ -*-.
/*
* Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration.
*/
/**
* @file CxxUtils/concepts.h
* @author scott snyder <snyder@bnl.gov>
* @date Apr, 2020
* @brief Compatibility helpers for using some pieces of C++20
* concepts with older compilers.
*
* Use ATH_REQUIRES for a requires clause:
*@code
* template <class T>
* ATH_REQUIRES( std::assignable_from<T, float> )
* void foo (T x);
@endcode
*
* The body of the ATH_REQUIRES will be hidden for compilers
* that don't support concepts.
*/
#ifndef CXXUTILS_CONCEPTS_H
#define CXXUTILS_CONCEPTS_H
#ifdef __cpp_concepts
#include <concepts>
#define ATH_REQUIRES(...) requires __VA_ARGS__
#else
#define ATH_REQUIRES(...)
#endif
#endif // not CXXUTILS_CONCEPTS_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment