Skip to content

File stdatomictype.h

File List > code_source > templat > include > TempLat > util > stdatomictype.h

Go to the documentation of this file

#ifndef TEMPLAT_UTIL_STDATOMICTYPE_H
#define TEMPLAT_UTIL_STDATOMICTYPE_H

/* This file is part of TempLat, available at https://cosmolattice.github.io/templat .
   Copyright 2021-2026 The TempLat authors, see AUTHORS.md.
   Released under the MIT license, see LICENSE.md. */

// File info: Main contributor(s): Adrien Florio, Year: 2025

#include <type_traits>

namespace TempLat
{

  template <typename T, typename = void> struct std_atomic_type {
    using type = T;
  };

  // Specialization: T has a nested value_type (i.e. is a container)
  template <typename T> struct std_atomic_type<T, std::void_t<typename T::value_type>> {
    using type = typename std_atomic_type<typename T::value_type>::type;
  };

} // namespace TempLat

#endif