Creates a std::array from the built-in array a. The elements of the std::array are copy-initialized from the corresponding element of a.
[edit] Parameters a - the built-in array to be used to initialize the std::array [edit] Return valueAn std::array object whose elements are copy-initialized from the corresponding element of a.
[edit] Possible implementation [edit] Example#include <cassert> #include <cstdlib> #include <experimental/array> #include <unistd.h> // mkstemp(3) that works template<std::size_t N> int tempfd(char const (&tmpl)[N]) { auto s = std::experimental::to_array(tmpl); int fd = mkstemp(s.data()); if (fd != -1) unlink(s.data()); return fd; } int main() { int fd = tempfd("/tmp/test.XXXXXX"); int rt = close(fd); assert(rt == 0); }[edit] See also
(library fundamentals TS v2)
creates a std::array object whose size and optionally element type are deduced from the argumentsRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4