
2015-05-07 2:25 GMT+02:00 Emil Dotchevski <emildotchevski@gmail.com>:
Q: Why doesn't QVM use [] or () to access vector and matrix elements?
A: Because it's designed to work with user-defined types, and the C++ standard requires these operators to be members. Of course if a user-defined type defines operator[] or operator() they are available for use with other QVM functions, but the generic access defined by QVM uses operator% instead.
Emil, correct me if I'm wrong. For higher dimensions the user would be forced to use traits explicitly: qvm::v_traits<vec_t>::r<I>(vec); qvm::m_traits<mat_t>::r<R, C>(mat); It'd also probably be possible to add a free function get, now or later if the users requested it: qvm::get<I>(vec); qvm::get<R, C>(mat); There are std::get, boost::get and boost::geometry::get serving similar purpose so it should be intuitive. Regards, Adam