Browse Source

array from C-array

devel
Ludovic 'Archivist' Lagouardette 4 years ago
parent
commit
6cdcdcd75b
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      include/gp/array.hpp

+ 8
- 0
include/gp/array.hpp View File

@ -19,6 +19,14 @@ namespace gp{
: ary{gp::forward(v...)} : ary{gp::forward(v...)}
{} {}
template<>
array<T[sz]>(T (&& oth)[sz]) {
gp::move_uninitialized(
gp::nameless_range(oth, oth+sz),
gp::nameless_range(*this)
);
}
constexpr T& operator[] (size_t off) constexpr T& operator[] (size_t off)
{ {
if constexpr (gp_config::has_buffer_bounds) if constexpr (gp_config::has_buffer_bounds)

Loading…
Cancel
Save