Skip to content

Commit 92f35c1

Browse files
committed
add [[nodiscard]] at various places
1 parent 2203ee0 commit 92f35c1

File tree

6 files changed

+25
-19
lines changed

6 files changed

+25
-19
lines changed

include/MGIS/Function/BasicLinearQuadratureSpace.hxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@ namespace mgis::function {
9090
const size_type) noexcept;
9191

9292
template <size_type N>
93-
constexpr bool areEquivalent(const BasicLinearQuadratureSpace<N>&,
94-
const BasicLinearQuadratureSpace<N>&) noexcept;
93+
[[nodiscard]] constexpr bool areEquivalent(
94+
const BasicLinearQuadratureSpace<N>&,
95+
const BasicLinearQuadratureSpace<N>&) noexcept;
9596

9697
} // end of namespace mgis::function
9798

include/MGIS/Function/BasicLinearSpace.hxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ namespace mgis::function {
4141

4242
constexpr size_type getSpaceSize(const BasicLinearSpace&) noexcept;
4343

44-
constexpr bool areEquivalent(const BasicLinearSpace&,
45-
const BasicLinearSpace&) noexcept;
44+
[[nodiscard]] constexpr bool areEquivalent(const BasicLinearSpace&,
45+
const BasicLinearSpace&) noexcept;
4646

4747
} // end of namespace mgis::function
4848

include/MGIS/Function/Evaluator.hxx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ namespace mgis::function {
2525
* \param[in] e1: first evaluator
2626
* \param[in] e2: second evaluator
2727
*/
28-
constexpr bool checkMatchingSpaces(AbstractErrorHandler&,
29-
const EvaluatorConcept auto&,
30-
const EvaluatorConcept auto&);
28+
[[nodiscard]] constexpr bool checkMatchingSpaces(
29+
AbstractErrorHandler&,
30+
const EvaluatorConcept auto&,
31+
const EvaluatorConcept auto&);
3132

3233
} // end of namespace mgis::function
3334

include/MGIS/Function/EvaluatorConcept.hxx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@ namespace mgis::function {
242242
* the allocateWorkspace function
243243
*/
244244
template <EvaluatorConcept EvaluatorType>
245-
constexpr bool disambiguateCheck(AbstractErrorHandler&, const EvaluatorType&);
245+
[[nodiscard]] constexpr bool disambiguateCheck(AbstractErrorHandler&,
246+
const EvaluatorType&);
246247
/*!
247248
* This helper function allows to disambiguate the call to
248249
* the allocateWorkspace function
@@ -254,7 +255,8 @@ namespace mgis::function {
254255
* the getNumberOfComponents function
255256
*/
256257
template <EvaluatorConcept EvaluatorType>
257-
constexpr mgis::size_type disambiguateGetNumberOfComponents(EvaluatorType&);
258+
[[nodiscard]] constexpr mgis::size_type disambiguateGetNumberOfComponents(
259+
EvaluatorType&);
258260

259261
/*!
260262
* \brief number of components of a type when known at compile-time,

include/MGIS/Function/Function.hxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ namespace mgis::function {
7777
};
7878

7979
//! \brief a simple helper function
80-
constexpr bool has_dynamic_properties(const FunctionDataLayoutDescription&);
80+
[[nodiscard]] constexpr bool has_dynamic_properties(
81+
const FunctionDataLayoutDescription&);
8182

8283
/*!
8384
* \brief a simple data structure describing how the data of a

include/MGIS/Function/SharedSpace.hxx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -139,31 +139,32 @@ namespace mgis::function {
139139
};
140140

141141
template <SpaceConcept SpaceType>
142-
bool areEquivalent(const SharedSpace<SpaceType>& s,
143-
const SharedSpace<SpaceType>& s2) noexcept {
142+
[[nodiscard]] bool areEquivalent(const SharedSpace<SpaceType>& s,
143+
const SharedSpace<SpaceType>& s2) noexcept {
144144
return s.get() == s2.get();
145145
}
146146

147147
template <SpaceConcept SpaceType>
148-
auto getSpaceSize(const SharedSpace<SpaceType>& s) {
148+
[[nodiscard]] auto getSpaceSize(const SharedSpace<SpaceType>& s) {
149149
return getSpaceSize(*s);
150150
}
151151

152152
template <QuadratureSpaceConcept SpaceType>
153-
auto getNumberOfCells(const SharedSpace<SpaceType>& s) {
153+
[[nodiscard]] auto getNumberOfCells(const SharedSpace<SpaceType>& s) {
154154
return getNumberOfCells(*s);
155155
}
156156

157157
template <QuadratureSpaceConcept SpaceType>
158-
auto getNumberOfQuadraturePoints(const SharedSpace<SpaceType>& s,
159-
const cell_index<SpaceType>& e) {
158+
[[nodiscard]] auto getNumberOfQuadraturePoints(
159+
const SharedSpace<SpaceType>& s, const cell_index<SpaceType>& e) {
160160
return getNumberOfQuadraturePoints(*s, e);
161161
}
162162

163163
template <LinearQuadratureSpaceConcept SpaceType>
164-
auto getQuadraturePointOffset(const SharedSpace<SpaceType>& s,
165-
const cell_index<SpaceType>& e,
166-
const quadrature_point_index<SpaceType>& i) {
164+
[[nodiscard]] auto getQuadraturePointOffset(
165+
const SharedSpace<SpaceType>& s,
166+
const cell_index<SpaceType>& e,
167+
const quadrature_point_index<SpaceType>& i) {
167168
return getQuadraturePointOffset(*s, e, i);
168169
}
169170

0 commit comments

Comments
 (0)