Skip to content

File hasexplicitcoordinatedependence.h

File List > algebra > helpers > hasexplicitcoordinatedependence.h

Go to the documentation of this file

#ifndef TEMPLAT_LATTICE_ALGEBRA_HELPERS_HASEXPLICITCOORDINATEDEPENDENCE_H
#define TEMPLAT_LATTICE_ALGEBRA_HELPERS_HASEXPLICITCOORDINATEDEPENDENCE_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): Wessel Valkenburg, Year: 2019

#include <type_traits>

namespace TempLat
{
  template <class T, class S = std::void_t<>> struct HasExplicitCoordinateDependence : public std::false_type {
  };

  template <class T> struct HasExplicitCoordinateDependence<T, std::void_t<decltype(T::EXPLICITCOORDINATEDEPENDENCE)>> {
    static constexpr bool value = T::EXPLICITCOORDINATEDEPENDENCE;
  };

  template <template <typename SS> class T, typename S> struct HasExplicitCoordinateDependence<T<S>, std::void_t<>> {
    static constexpr bool value = HasExplicitCoordinateDependence<S>::value;
  };

  template <template <typename SS, typename SSS> class T, typename S1, typename S2>
  struct HasExplicitCoordinateDependence<T<S1, S2>, std::void_t<>> {
    static constexpr bool value =
        HasExplicitCoordinateDependence<S1>::value || HasExplicitCoordinateDependence<S2>::value;
  };

} // namespace TempLat

#endif