From d5083302950940c30db0b27681ff125157661f54 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Tue, 30 Dec 2014 01:28:17 +1100 Subject: [PATCH] coord: add single element constructor --- detail/coord.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/detail/coord.hpp b/detail/coord.hpp index e524a923..14f22078 100644 --- a/detail/coord.hpp +++ b/detail/coord.hpp @@ -38,6 +38,9 @@ namespace util { struct coord { coord () { ; } + coord (T v) + { std::fill (std::begin (data), std::end (data), v); } + template coord (U ..._u): data{_u...} { ; } @@ -52,6 +55,9 @@ namespace util { struct coord<1,T> { coord () { ; } + coord (T v) + { std::fill (std::begin (data), std::end (data), v); } + template coord (U ..._u): data{_u...} { ; } @@ -69,6 +75,9 @@ namespace util { struct coord<2,T> { coord () { ; } + coord (T v) + { std::fill (std::begin (data), std::end (data), v); } + template coord (U ..._u): data{_u...} { ; } @@ -107,6 +116,9 @@ namespace util { coord () { ; } + coord (T v) + { std::fill (std::begin (data), std::end (data), v); } + template coord (U... u): data{u...} { ; } @@ -144,6 +156,9 @@ namespace util { coord () { ; } + coord (T v) + { std::fill (std::begin (data), std::end (data), v); } + template coord (U... u): data{u...} { ; }