You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
571 B
34 lines
571 B
6 years ago
|
// -*- c++ -*-
|
||
|
|
||
|
namespace std {
|
||
|
template <class C> auto begin(C& c) -> decltype(c.begin())
|
||
|
{
|
||
|
return c.begin();
|
||
|
}
|
||
|
|
||
|
template <class C> auto begin(const C& c) -> decltype(c.begin())
|
||
|
{
|
||
|
return c.begin();
|
||
|
}
|
||
|
|
||
|
template <class C> auto end(C& c) -> decltype(c.end())
|
||
|
{
|
||
|
return c.end();
|
||
|
}
|
||
|
|
||
|
template <class C> auto end(const C& c) -> decltype(c.end())
|
||
|
{
|
||
|
return c.end();
|
||
|
}
|
||
|
|
||
|
template <class T, size_t N> T* begin(T (&array)[N])
|
||
|
{
|
||
|
return &array[0];
|
||
|
}
|
||
|
|
||
|
template <class T, size_t N> T* end(T (&array)[N])
|
||
|
{
|
||
|
return &array[N];
|
||
|
}
|
||
|
}
|