This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
coding conventions
- From: Michael <boost at cyberfiber dot org>
- Cc: gdb-patches at sourceware dot org
- Date: Sat, 02 Jan 2010 22:24:41 +0100
- Subject: coding conventions
hi all,
here's a first patch:
it was generated using the command 'svn diff > ../boost.diff"
questions on the formatting of new code (conforming standards used at
gdb-patches@gnu.org):
1) can lines exceed the 80 character limit?
2) should standard indentation be taken as 2 or 4 white spaces?
the attachment can be applied as such.
Greetz,
Michael
Index: boost/numeric/ublas/io.hpp
===================================================================
--- boost/numeric/ublas/io.hpp (revision 58644)
+++ boost/numeric/ublas/io.hpp (working copy)
@@ -19,27 +19,40 @@
#include <boost/numeric/ublas/matrix_expression.hpp>
-namespace boost { namespace numeric { namespace ublas {
+namespace boost
+{
+ namespace numeric
+ {
+ namespace ublas
+ {
- template<class E, class T, class VE>
- // BOOST_UBLAS_INLINE This function seems to be big. So we do not let the compiler inline it.
- std::basic_ostream<E, T> &operator << (std::basic_ostream<E, T> &os,
- const vector_expression<VE> &v) {
- typedef typename VE::size_type size_type;
- size_type size = v ().size ();
- std::basic_ostringstream<E, T, std::allocator<E> > s;
- s.flags (os.flags ());
- s.imbue (os.getloc ());
- s.precision (os.precision ());
- s << '[' << size << "](";
- if (size > 0)
- s << v () (0);
- for (size_type i = 1; i < size; ++ i)
- s << ',' << v () (i);
- s << ')';
- return os << s.str ().c_str ();
- }
+ template<class E, class T, class VE>
+ std::basic_ostream<E, T> &operator <<
+ (std::basic_ostream<E, T> &os, const vector_expression<VE> &v)
+ {
+ typedef typename VE::size_type size_type;
+ size_type size = v ().size ();
+
+ std::basic_ostringstream<E, T, std::allocator<E> > s;
+
+ s.flags (os.flags ());
+ s.imbue (os.getloc ());
+ s.precision (os.precision ());
+
+ s << '[' << size << "](";
+
+ if (size > 0) s << v () (0);
+
+ for (size_type i = 1; i < size; ++ i)
+ {
+ s << ',' << v () (i);
+ s << ')';
+ }
+
+ return os << s.str ().c_str ();
+ }
+
template<class E, class T, class VT, class VA>
// BOOST_UBLAS_INLINE This function seems to be big. So we do not let the compiler inline it.
std::basic_istream<E, T> &operator >> (std::basic_istream<E, T> &is,