Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::valarray<T>::valarray

      From cppreference.com
      <cpp‎ |numeric‎ |valarray
       
       
       
      std::valarray
      Member functions
      Non-member functions
      Helper classes
      Deduction guides(C++17)
       
      valarray();
      (1)
      explicit valarray(std::size_t count);
      (2)
      valarray(const T& val,std::size_t count);
      (3)
      valarray(const T* vals,std::size_t count);
      (4)
      valarray(const valarray& other);
      (5)
      valarray( valarray&& other)noexcept;
      (6)(since C++11)
      valarray(conststd::slice_array<T>& sa);
      (7)
      valarray(conststd::gslice_array<T>& gsa);
      (8)
      valarray(conststd::mask_array<T>& ma);
      (9)
      valarray(conststd::indirect_array<T>& ia);
      (10)
      valarray(std::initializer_list<T> il);
      (11)(since C++11)

      Constructs new numeric array from various sources.

      1) Default constructor. Constructs an empty numeric array.
      2) Constructs a numeric array withcount copies ofvalue-initialized elements.
      3) Constructs a numeric array withcount copies ofval.
      4) Constructs a numeric array with copies ofcount values from an array pointed to byvals. If this array contains less thancount values, the behavior is undefined.
      5) Copy constructor. Constructs the numeric array with the copy of the contents ofother.
      6) Move constructor. Constructs the container with the contents ofother using move semantics.
      7-10)Converting constructor. Convert the corresponding data structure to avalarray.
      11) Constructs the numeric array with the contents of the initializer listil.

      [edit]Parameters

      count - the number of elements to construct
      val - the value to initialize the elements with
      vals - pointer to a C array to use as source to initialize the contents
      other - another numeric array to use as source to initialize the contents
      sa - slice array to initialize the elements with
      gsa - generic slice array to initialize the elements with
      ma - mask array to initialize the elements with
      ia - indirect array to initialize the elements with
      il - initializer list to initialize the elements with

      [edit]Exceptions

      1-5, 7-11) May throw implementation-defined exceptions.

      [edit]Example

      This section is incomplete
      Reason: no example
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/numeric/valarray/valarray&oldid=151456"

      [8]ページ先頭

      ©2009-2025 Movatter.jp