Dune Core Modules (2.6.0)

array.hh
Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3
4#ifndef DUNE_ARRAY_HH
5#define DUNE_ARRAY_HH
6
7#ifndef DUNE_COMMON_ARRAY_HH_DISABLE_DEPRECATION_WARNING
8
9#warning This header is deprecated.
10#warning Instead of Dune::array, use std::array from <array>.
11#warning Instead of Dune::make_array(), use Dune::Std::make_array() from <dune/common/std/make_array.hh>.
12#warning Instead of Dune::fill_array(), use Dune::filledArray() from <dune/common/filledarray.hh>.
13
14#endif // DUNE_DISABLE_ARRAY_HH_DEPRECATION_WARNING
15
20#include <array>
21
24#include <dune/common/std/make_array.hh>
25
26namespace Dune
27{
33 // pull in default implementation
34 // deprecation does not work:
35 // DUNE_DEPRECATED_MSG("Use std::array from <array>")
36 using std::array;
37
38 // deprecation does not work:
39 // DUNE_DEPRECATED_MSG("Use Dune::Std::make_array from <dune/common/std/make_array.hh>")
41
43
50 template<typename T, std::size_t n>
51 DUNE_DEPRECATED_MSG("Use Dune::filledArray() from <dune/common/filledarray.hh>")
52 std::array<T,n> fill_array(const T& t)
53 {
54 std::array<T,n> r;
55 r.fill(t);
56 return r;
57 }
58
61} // end namespace Dune
62
63#endif
Definition of the DUNE_DEPRECATED macro for the case that config.h is not available.
std::array< typename std::common_type< Args... >::type, sizeof...(Args)> make_array(const Args &... args)
Create and initialize an array.
Definition: make_array.hh:36
#define DUNE_DEPRECATED_MSG(text)
Mark some entity as deprecated.
Definition: deprecated.hh:169
std::array< T, n > fill_array(const T &t)
Create an array and fill it with copies of the provided value.
Definition: array.hh:52
Dune namespace.
Definition: alignedallocator.hh:10
STL namespace.
Implementation of stream operators for std::array and std::tuple.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 24, 23:30, 2024)