octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Octave coding conventions


From: Rik
Subject: Re: Octave coding conventions
Date: Mon, 13 Jan 2020 09:02:28 -0800

How strictly do we want to enforce a line break after the return type in a
function declaration?  We mostly do this, but not always.  For example, in
Array.cc there is

template <typename T>
Array<T>
Array<T>::permute (const Array<octave_idx_type>& perm_vec_arg, bool inv) const

but also

template <typename T>
T * do_index (const T *src, T *dest, int lev) const

And do we want to enforce this convention in .cc files only or also .h
files?  For example, Array.h contains

octave_idx_type numel (void) const { return len; }

which is small and compact, but if enforcing the return type for a function
would become

octave_idx_type
numel (void) const { return len; }

There is no problem with declarations in a header file as that is a
separate switch to throw in astyle.

--Rik



reply via email to

[Prev in Thread] Current Thread [Next in Thread]