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

I learned C

Name: Anonymous 2007-04-05 4:23 ID:XM7baoLH

What do I read to learn C++?

I like books with little text and lots of short example code. But anything good is fine.

Name: Anonymous 2007-04-05 12:58 ID:F51LfmFx

>>6
LOL

I downloaded that book thinking knowing some C++ couldn't hurt. It might even make me a better programmer. Etc.

Then I see code like

template<class T> class Ptr { public:
    // new member to copy the object conditionally when needed 
    void make_unique() {
        if (*refptr != 1) {
            --*refptr;
            refptr = new size_t(1);
            p = p ? p->clone() : 0;
        }
    }
    
    // the rest of the class looks like Ref_handle except for its name
    Ptr(): refptr(new size_t(l)), p(0) { }
    Ptr(T* t): refptr(new size_t(l)), p(t) { }
    Ptr(const Ptr& h): refptr(h.refptr), p(h.p) { ++*refptr; }
    Ptr& operator=(const Ptr&) ;   // implemented analogously to §14.2/261
    ~Ptr();                        // implemented analogously to §14.2/262
    operator bool() const { return p; }
    T& operator*() const;,         // implemented analogously to §14.2/261
    T* operator->() const;         // implemented analogously to §14.2/261
private:
    T* p;
    size_t* refptr;
};


?????????????????

Back to Haskell it is.

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