2015-04-20 18:06:47 +00:00
|
|
|
/* Initializer list support for OctaSTD.
|
|
|
|
*
|
|
|
|
* This file is part of OctaSTD. See COPYING.md for futher information.
|
|
|
|
*/
|
|
|
|
|
2015-07-13 19:08:55 +00:00
|
|
|
#ifndef OSTD_INITIALIZER_LIST_HH
|
|
|
|
#define OSTD_INITIALIZER_LIST_HH
|
2015-04-20 18:06:47 +00:00
|
|
|
|
2017-01-14 14:09:27 +00:00
|
|
|
#include <initializer_list>
|
2015-04-20 18:06:47 +00:00
|
|
|
|
2015-07-13 19:08:55 +00:00
|
|
|
#include "ostd/range.hh"
|
2015-04-20 18:06:47 +00:00
|
|
|
|
2015-07-13 19:07:14 +00:00
|
|
|
namespace ostd {
|
2015-05-28 18:58:05 +00:00
|
|
|
|
2015-06-04 21:57:06 +00:00
|
|
|
template<typename T>
|
2016-09-11 19:17:49 +00:00
|
|
|
PointerRange<T const> iter(std::initializer_list<T> init) noexcept {
|
2016-06-23 18:18:35 +00:00
|
|
|
return PointerRange<T const>(init.begin(), init.end());
|
2015-06-03 21:56:01 +00:00
|
|
|
}
|
|
|
|
|
2015-06-09 20:18:43 +00:00
|
|
|
template<typename T>
|
2016-09-11 19:17:49 +00:00
|
|
|
PointerRange<T const> citer(std::initializer_list<T> init) noexcept {
|
2016-06-23 18:18:35 +00:00
|
|
|
return PointerRange<T const>(init.begin(), init.end());
|
2015-06-09 20:18:43 +00:00
|
|
|
}
|
|
|
|
|
2015-04-20 18:06:47 +00:00
|
|
|
}
|
|
|
|
|
2016-02-07 21:17:15 +00:00
|
|
|
#endif
|