Skip to content

Commit 39f20af

Browse files
Guards around usage of std::initializer_list in optional.h
In optional.h, ETL_HAS_INITIALIZER_LIST is being used to guard against cases where std::initializer_list is not available. But not consistently. This changes fixes it by adding it in the remaining places.
1 parent f9cf20d commit 39f20af

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/etl/optional.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ namespace etl
195195
storage.construct(etl::forward<TArgs>(args)...);
196196
}
197197

198+
#if ETL_HAS_INITIALIZER_LIST
198199
//*******************************************
199200
/// Construct from initializer_list and arguments.
200201
//*******************************************
@@ -205,6 +206,7 @@ namespace etl
205206
{
206207
storage.construct(ilist, etl::forward<TArgs>(args)...);
207208
}
209+
#endif
208210
#endif
209211

210212
//***************************************************************************
@@ -816,6 +818,7 @@ namespace etl
816818
storage.construct(etl::forward<TArgs>(args)...);
817819
}
818820

821+
#if ETL_HAS_INITIALIZER_LIST
819822
//*******************************************
820823
/// Construct from initializer_list and arguments.
821824
//*******************************************
@@ -826,6 +829,7 @@ namespace etl
826829
{
827830
storage.construct(ilist, etl::forward<TArgs>(args)...);
828831
}
832+
#endif
829833
#endif
830834

831835
//***************************************************************************

0 commit comments

Comments
 (0)