105105 if (!MGIS_TEMPORARY_VARIABLE(v).has_value()) { \
106106 return InvalidResult{}; \
107107 } \
108- Type & v = *(MGIS_TEMPORARY_VARIABLE(v));
108+ Type& v = *(MGIS_TEMPORARY_VARIABLE(v))
109109
110110/* !
111111 * \brief an helper macro to build an unique pointer for type the constructor of
119119 std::unique_ptr<Type> v = MGIS_MAKE_UNIQUE(Type, e, __VA_ARGS__); \
120120 if (v.get() == nullptr ) { \
121121 return InvalidResult{}; \
122- }
122+ } \
123+ static_cast <void >(0 )
123124
124125/* !
125126 * \brief an helper macro to build an unique pointer for type the constructor of
135136 MGIS_MAKE_UNIQUE_AS (BaseType, Type, e, __VA_ARGS__); \
136137 if (v.get() == nullptr ) { \
137138 return InvalidResult{}; \
138- }
139+ } \
140+ static_cast <void >(0 )
139141
140142/* !
141143 * \brief an helper macro to build an shared pointer for type the constructor of
149151 std::shared_ptr<Type> v = MGIS_MAKE_SHARED(Type, e, __VA_ARGS__); \
150152 if (v.get() == nullptr ) { \
151153 return InvalidResult{}; \
152- }
154+ } \
155+ static_cast <void >(0 )
153156
154157/* !
155158 * \brief an helper macro to build an shared pointer for type the constructor of
165168 MGIS_MAKE_SHARED_AS (BaseType, Type, e, __VA_ARGS__); \
166169 if (v.get() == nullptr ) { \
167170 return InvalidResult{}; \
168- }
171+ } \
172+ static_cast <void >(0 )
169173
170174namespace mgis {
171175
@@ -184,11 +188,11 @@ namespace mgis {
184188 * \param[in] args: arguments passed to the constructor
185189 */
186190 template <typename Type, typename ... ArgumentsTypes>
187- [[nodiscard]] std::optional<Type> construct (
188- Context &,
189- const std::source_location &,
190- ArgumentsTypes &&...) noexcept requires
191- std::is_constructible_v<std::remove_const_t<Type>, ArgumentsTypes...>;
191+ [[nodiscard]] std::optional<Type> construct (Context&,
192+ const std::source_location &,
193+ ArgumentsTypes&&...) noexcept
194+ requires std::is_constructible_v<std::remove_const_t<Type>,
195+ ArgumentsTypes...>;
192196 /* !
193197 * \brief try to build a unique pointer holding the given type.
194198 *
@@ -203,11 +207,11 @@ namespace mgis {
203207 * \param[in] args: arguments passed to the constructor
204208 */
205209 template <typename Type, typename ... ArgumentsTypes>
206- [[nodiscard]] std::unique_ptr<Type> make_unique (
207- Context &,
208- const std::source_location &,
209- ArgumentsTypes &&...) noexcept requires
210- std::is_constructible_v<std::remove_const_t<Type>, ArgumentsTypes...>;
210+ [[nodiscard]] std::unique_ptr<Type> make_unique (Context&,
211+ const std::source_location &,
212+ ArgumentsTypes&&...) noexcept
213+ requires std::is_constructible_v<std::remove_const_t<Type>,
214+ ArgumentsTypes...>;
211215 /* !
212216 * \brief try to build a unique pointer of a base type holding the given type.
213217 *
@@ -223,9 +227,10 @@ namespace mgis {
223227 */
224228 template <typename BaseType, typename Type, typename ... ArgumentsTypes>
225229 [[nodiscard]] std::unique_ptr<BaseType> make_unique_as (
226- Context &, const std::source_location &, ArgumentsTypes &&...) noexcept
227- requires std::is_base_of_v<BaseType, Type> &&
228- std::is_constructible_v<std::remove_const_t<Type>, ArgumentsTypes...>;
230+ Context&, const std::source_location&, ArgumentsTypes&&...) noexcept
231+ requires std::is_base_of_v<BaseType, Type> &&
232+ std::is_constructible_v<std::remove_const_t<Type>,
233+ ArgumentsTypes...>;
229234 /* !
230235 * \brief try to build a shared pointer holding the given type.
231236 *
@@ -239,11 +244,11 @@ namespace mgis {
239244 * \param[in] args: arguments passed to the constructor
240245 */
241246 template <typename Type, typename ... ArgumentsTypes>
242- [[nodiscard]] std::shared_ptr<Type> make_shared (
243- Context &,
244- const std::source_location &,
245- ArgumentsTypes &&...) noexcept requires
246- std::is_constructible_v<std::remove_const_t<Type>, ArgumentsTypes...>;
247+ [[nodiscard]] std::shared_ptr<Type> make_shared (Context&,
248+ const std::source_location &,
249+ ArgumentsTypes&&...) noexcept
250+ requires std::is_constructible_v<std::remove_const_t<Type>,
251+ ArgumentsTypes...>;
247252 /* !
248253 * \brief try to build a shared pointer of a base type holding the given type.
249254 *
@@ -259,9 +264,10 @@ namespace mgis {
259264 */
260265 template <typename BaseType, typename Type, typename ... ArgumentsTypes>
261266 [[nodiscard]] std::shared_ptr<BaseType> make_shared_as (
262- Context &, const std::source_location &, ArgumentsTypes &&...) noexcept
263- requires std::is_base_of_v<BaseType, Type> &&
264- std::is_constructible_v<std::remove_const_t<Type>, ArgumentsTypes...>;
267+ Context&, const std::source_location&, ArgumentsTypes&&...) noexcept
268+ requires std::is_base_of_v<BaseType, Type> &&
269+ std::is_constructible_v<std::remove_const_t<Type>,
270+ ArgumentsTypes...>;
265271
266272#endif
267273
@@ -278,9 +284,10 @@ namespace mgis {
278284 * \param[in] args: arguments passed to the constructor
279285 */
280286 template <typename Type, typename ... ArgumentsTypes>
281- [[nodiscard]] std::optional<Type> construct (
282- Context &, ArgumentsTypes &&...) noexcept requires
283- std::is_constructible_v<std::remove_const_t<Type>, ArgumentsTypes...>;
287+ [[nodiscard]] std::optional<Type> construct (Context&,
288+ ArgumentsTypes&&...) noexcept
289+ requires std::is_constructible_v<std::remove_const_t<Type>,
290+ ArgumentsTypes...>;
284291 /* !
285292 * \brief try to build a unique pointer holding the given type.
286293 *
@@ -295,9 +302,10 @@ namespace mgis {
295302 * \param[in] args: arguments passed to the constructor
296303 */
297304 template <typename Type, typename ... ArgumentsTypes>
298- [[nodiscard]] std::unique_ptr<Type> make_unique (
299- Context &, ArgumentsTypes &&...) noexcept requires
300- std::is_constructible_v<std::remove_const_t<Type>, ArgumentsTypes...>;
305+ [[nodiscard]] std::unique_ptr<Type> make_unique (Context&,
306+ ArgumentsTypes&&...) noexcept
307+ requires std::is_constructible_v<std::remove_const_t<Type>,
308+ ArgumentsTypes...>;
301309 /* !
302310 * \brief try to build a unique pointer of a base type holding the given type.
303311 *
@@ -313,9 +321,10 @@ namespace mgis {
313321 */
314322 template <typename BaseType, typename Type, typename ... ArgumentsTypes>
315323 [[nodiscard]] std::unique_ptr<BaseType> make_unique_as (
316- Context &, ArgumentsTypes &&...) noexcept requires
317- std::is_base_of_v<BaseType, Type> &&
318- std::is_constructible_v<std::remove_const_t<Type>, ArgumentsTypes...>;
324+ Context&, ArgumentsTypes&&...) noexcept
325+ requires std::is_base_of_v<BaseType, Type> &&
326+ std::is_constructible_v<std::remove_const_t<Type>,
327+ ArgumentsTypes...>;
319328 /* !
320329 * \brief try to build a shared pointer holding the given type.
321330 *
@@ -329,9 +338,10 @@ namespace mgis {
329338 * \param[in] args: arguments passed to the constructor
330339 */
331340 template <typename Type, typename ... ArgumentsTypes>
332- [[nodiscard]] std::shared_ptr<Type> make_shared (
333- Context &, ArgumentsTypes &&...) noexcept requires
334- std::is_constructible_v<std::remove_const_t<Type>, ArgumentsTypes...>;
341+ [[nodiscard]] std::shared_ptr<Type> make_shared (Context&,
342+ ArgumentsTypes&&...) noexcept
343+ requires std::is_constructible_v<std::remove_const_t<Type>,
344+ ArgumentsTypes...>;
335345 /* !
336346 * \brief try to build a shared pointer of a base type holding the given type.
337347 *
@@ -347,9 +357,10 @@ namespace mgis {
347357 */
348358 template <typename BaseType, typename Type, typename ... ArgumentsTypes>
349359 [[nodiscard]] std::shared_ptr<BaseType> make_shared_as (
350- Context &, ArgumentsTypes &&...) noexcept requires
351- std::is_base_of_v<BaseType, Type> &&
352- std::is_constructible_v<std::remove_const_t<Type>, ArgumentsTypes...>;
360+ Context&, ArgumentsTypes&&...) noexcept
361+ requires std::is_base_of_v<BaseType, Type> &&
362+ std::is_constructible_v<std::remove_const_t<Type>,
363+ ArgumentsTypes...>;
353364
354365} // end of namespace mgis
355366
0 commit comments