std::valarray::min(3)
π NAME π
Okay bestie, this is the std::valarray::min(3) page from the C++ Standard Libary manpage set β yes, βLibaryβ is literally how itβs written up there, and Iβm leaving it exactly as-is π
.
std::valarray::min β and the name is literally std::valarray::min. No cap, thatβs the whole NAME section.
β¨ Synopsis β¨
Signature, served fresh:
T min() const;
This computes the minimum value of the elements. Very βfind the smallest one and slay,β lowkey. πΈ
If there are no elements, the behavior is undefined. Thatβs not a cute mysterious vibe β itβs undefined behavior, bestie, so please do not call this on an empty valarray and expect main-character safety. π
The function can be used only if operator< is defined for type T. Like, no operator< for T, no min. Periodt. π
π Parameters π
(none) β zero parameters. Not a single one. The parameter section is empty and thriving. π«Ά
πΈ Return value πΈ
The minimum of the elements. Thatβs it. Thatβs the return value. π
π¦ Example π¦
The page says // Run this code, so hereβs the exact code:
// Run this code
#include <valarray>
#include <iostream>
int main()
{
std::valarray<double> a{1, 2, 3, 4, 5, 6, 7, 8};
std::cout << "Minimum value : " << a.min() << "\n";
}
π Output π
Minimum value : 1
π See also π
maxβ returns the largest element (public member function). The iconic opposite-energy bestie tomin. π
Thatβs the whole page, bestie β source: http://cppreference.com, version/date: 2024.06.10. Stay cozy, check your empties, and may your valarray always be non-empty. π
β¨π
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms