Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Indent style

Name: Anonymous 2010-09-01 6:41

Don't you hate it when people indent their code like this?

template
<class C>
C*
v_DoSomething (    C a,
        C b,
        C c   )
{
    C* _ptrResult = &a;
    if ( a >= b )
    {
        return ( _ptrResult );
    }
    else
    {
        if ( b >= c )
        {
            return &c;
        }
        else
        {
            return _ptrResult;
        }
    }
}

Name: Anonymous 2010-09-01 15:20

>>1
This is a decent style.  Readable.
There are a few unnecessary newlines, though.


template <class C> C* v_DoSomething (C a, C b, C c)
{
    C* _ptrResult = &a;

    if (a >= b)
    {
        return (_ptrResult);
    }
    else
    {
        if (b >= c)
        {
            return &c;
        }
        else
        {
            return _ptrResult;
        }
    }
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List