fixed a lot of issues, now successfully runs the test with --enable-pedantic; refs #8

This commit is contained in:
Marc Wäckerlin
2014-03-28 11:50:39 +00:00
parent e846c326f1
commit 190b469d56
33 changed files with 398 additions and 409 deletions

View File

@@ -50,12 +50,50 @@
@pre \#include <mrw/vector.hxx>
*/
template <typename T, typename A>
std::vector<T, A> operator<<(std::vector<T, A> l, const T& o)
std::vector<T, A>& operator<<(std::vector<T, A>& l, const T& o)
throw(std::bad_exception) {
l.push_back(o);
return l;
}
/** @brief push a value to a constant vector
Makes a copy and returns the copy.
@code
std::vector<int>()<<1<<2<<3<<4<<5<<6<<7<<8;
@endcode
@param l a vector of values
@param o a value to be inserted into vector @c l
@pre \#include <mrw/vector.hxx>
*/
template <typename T, typename A>
std::vector<T, A> operator<<(const std::vector<T, A>& l, const T& o)
throw(std::bad_exception) {
std::vector<T, A> copy(l);
copy.push_back(o);
return ;
}
/* @brief push a char* to a vector of string
@code
std::vector<std::string> test;
test<<"Hello"<<"World";
@endcode
@param l a vector of string values (that can be constructed from char*)
@param o a value to be inserted into vector @c l
@pre \#include <mrw/vector.hxx> */
template <typename T, typename A>
std::vector<T, A>& operator<<(std::vector<T, A>& l,
const char *const o)
throw(std::bad_exception) {
l.push_back(T(o));
return l;
}
/** @brief extract the first value of a vector
@code