// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: BSD-3-Clause

/*!\file
 * \brief The [\<new\> header](https://en.cppreference.com/w/cpp/header/new) from C++17's standard library.
 * \author Rene Rahn <rene.rahn AT fu-berlin.de>
 */

// File might be included from multiple libraries.
#ifndef SEQAN_STD_NEW_SHIM
#define SEQAN_STD_NEW_SHIM

#include <new>

#ifndef __cpp_lib_hardware_interference_size

/*!\defgroup std std
 * \brief A subset of the C++20 standard library made available in pre-C++20 contexts.
 *
 * \details
 *
 * This module provides many parts of the C++20 standard library (and some parts of the C++17 standard library
 * not available in GCC). They are only defined if not found in the compiler's standard library and are called exactly
 * like the originals so they can be used interchangeably.
 *
 * \attention All of this sub-module is subject to change!
 *
 * In particular:
 *
 *   * We do not provide all C++20 library features, only those that are used by SeqAn.
 *   * All of these might change or be removed once C++20 is published.
 *   * The documentation of this module will likely be removed entirely in favour of links to
 *     https://en.cppreference.com
 *
 * It is best you consider every entity in this module as:
 *
 * \noapi
 *
 */

/*!\defgroup std_new new
 * \ingroup std
 * \brief The [\<new\> header](https://en.cppreference.com/w/cpp/header/new) from C++17's standard library.
 */

namespace std
{

/*!\brief Minimum offset between two objects to avoid false sharing.
 * \ingroup std_new
 * \sa https://en.cppreference.com/w/cpp/thread/hardware_destructive_interference_size
 */
inline constexpr std::size_t hardware_destructive_interference_size = 64;

/*!\brief Maximum size of contiguous memory to promote true sharing.
 * \ingroup std_new
 * \sa https://en.cppreference.com/w/cpp/thread/hardware_destructive_interference_size
 */
inline constexpr std::size_t hardware_constructive_interference_size = 64;

} // namespace std

#endif // __cpp_lib_hardware_interference_size

#endif // SEQAN_STD_NEW_SHIM
