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

Coding style, the ultimate thread.

Name: Anonymous 2010-07-31 4:02

Language: C
Typedefs: foo_t
Functions: stuff_with_underscores()
Brackets: linux-style ('\n' before '{')

Language: C++
Typedefs for primtive types: foo_t
Class declarations: class FooBar ...
Functions: stuff_with_underscores()
Methods: stuff_with_underscores()
Brackets: linux-style ('\n' before '{')

Name: Anonymous 2010-07-31 5:36

namespace anus
{
    class explorer
    {
        explorer(explorer const&) = delete;
        explorer& operator=(explorer const&) = delete;

    protected:

        explorer();

        explicit explorer(shared_ptr<digging_tool> const& t);

    public:

        virtual ~explorer();

        virtual void discover_treasure() = 0;

        shared_ptr<digging_tool> const& tool() const;

        void tool(shared_ptr<digging_tool> const& t);

    private:

        shared_ptr<digging_tool> tool_;
    };

    inline explorer::explorer() {
    }

    inline explorer::explorer(shared_ptr<digging_tool> const& t)
    : tool_(t) {
    }

    inline shared_ptr<digging_tool> const& explorer::tool() const {
        return tool_;
    }

    inline void explorer::tool(shared_ptr<digging_tool> const& t) {
        tool_ = t;
    }
}

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