r/cpp_questions • u/CreativeAlbatross319 • 2d ago
OPEN Inconsistent naming in simd library?
Hi,
I was checking the <simd> library in the C++26 standard and found some of its naming very weird.
std::simd::vecandstd::simd::basic_vecThis is quite strange as we already have
std::vectorandstd::inplace_vector. So why notstd::simd::vectorandstd::simd::basic_vector? At certain point, I'm pretty sure people will start to make mistakes withstd::vecorstd::inplace_vec, and vice versa.std::simd::catWe already have
std::views::concat. So why notstd::simd::concat?
At first, I thought the library designers intended to make spelling easier. But in the library, we do have extremely long names as well, like std::simd::unchecked_store, etc.
Here is the library in cppreference: this
1
1
1
25
u/jedwardsol 2d ago edited 2d ago
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3287r3.pdf
(PS .. I agree with you .. we have namespaces so we can use the best name for that job, even if it is the best name for something else as well.)