Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* coding conventions
@ 2010-01-02 21:24 Michael
  2010-01-03  3:17 ` Joel Brobecker
  0 siblings, 1 reply; 3+ messages in thread
From: Michael @ 2010-01-02 21:24 UTC (permalink / raw)
  Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 354 bytes --]

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


[-- Attachment #2: boost.diff --]
[-- Type: text/x-patch, Size: 2019 bytes --]

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,


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-01-03 10:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-02 21:24 coding conventions Michael
2010-01-03  3:17 ` Joel Brobecker
2010-01-03 10:34   ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox