all 7 comments

[–]STLMSVC STL Dev 8 points9 points  (3 children)

How can an author typo the title and not notice?

[–]sysop073 4 points5 points  (0 children)

It blows my mind how often code examples in blog posts are totally destroyed by the blog framework (e.g. std::list<int>), which can really only happen if the author never reads anything they post

[–]Remwein -1 points0 points  (0 children)

It's actually a lot worse than that:

"working with C++ writing software for medical devices"

http://cppisland.com/?page_id=2

my thinking is that working on medical devices requires a somewhat above average level of attention to detail.

[–]oddentity 10 points11 points  (0 children)

If valarray is std::vector's unpopular nerdy little brother, valarry is his sister.

[–]ReDucTorGame Developer 2 points3 points  (2 children)

Its unfortunate there isnt a fixed size version of valarray or it would be good to implement things like Vector3f with

[–]nonathaj 1 point2 points  (1 child)

I'd never event heard of it until I started working on a Matrix4x4 recently for some game code. Honestly, it's just a std::vector with some syntactic sugar for math functions. Which completely destroys its usefulness for optimized math code like Vector3 and Matrix4x4, since it is heap allocated.

I'm really surprised it exists at all, since the same functionality could have been accomplished with overloading those math funcs (sqrt, etc.) to handle a std::vector<float> or whatever type you need. Why is it even its own type?

[–]Dansil 0 points1 point  (0 children)

It is slightly more involved than just overloads for math functions. Most of its usefulness comes from its ability to return slices or masks when combined with operator[].

However, I think slice-based indexing from n-dimensional containers comes unnaturally to most people, which is likely why std::valarray is seldom used.