Back to Profile: Int64


  • C9 Lectures: Stephan T Lavavej - Advanced STL, 5 of n

    Something I just remembered - if you want a quick and easy way to start using boost, this site provides an installer for the headers and pre-built binaries: (VS2003-VS2010, 32-bit only)

    , C64 wrote

    BTW: Does it work properly with Unicode characters? I see your code uses std::string, it would be good if we could safely use it with Unicode filenames. Or does Boost.Filesystem use UTF-8 as Unicode encoding instead of UTF-16, so std::string is OK in this case?

    Thanks for clarifying this.

    The path class supports multiple character types. So you can replace these:

    void free_function(std::string const& file_name);
    void free_function(std::wstring const& file_name);

    with this:

    void free_function(boost::filesystem::path const& file_name);

    One function instead of one for each string type you need to support.

  • C9 Lectures: Stephan T Lavavej - Advanced STL, 5 of n

    Boost is truly great, not just from a content standpoint, but in how fast they release new versions/updates. I'm using it primary for TR1 support, but there's alot of other excellent stuff I've used:

    • String Algorithms/Format (boost::format is probably my most frequently used non-TR1 feature)
    • UUID
    • Exceptions/error_info
    • Serialization
    • noncopyable
    • Slots/Signals
    • Threads
    • checked_delete
    • FileSystem/path
    • Date/Time
    • IOStreams/zlib support
    • ASIO (networking)
    • Test (Although, I actually prefer UnitTest++ for unit testing)

    I'm off to try mapped files, something I can use that I wasn't aware of - thanks Thomas.

    , Deraynger wrote

    Some general questions:

    How would you return the vertices vector to an OpenGL function? What I do is (don't have it here, but somehow) something like:

    inlineconst vector<vert3>& Verts( void ) const
    // Somewhere in loop code
    glDrawElements( someVal, someVal, someVal, &myObj->Verts()[0] );

    Why not just return the pointer?

    vert3 const* Foo::vertices_data() const
        if (_vertices.empty())
            throw std::runtime_error("See Effective STL, item 16");
        return &_vertices[0];
    Foo foo;
    vert3 const* data = foo.vertices_data();

  • Tony Goodhew: VC++ Developer ​Communicati​on - Questions and Answers

    What I'd like to see is a stand-alone VC++ product like you had back in the 90s. (I think it was called VC++ Pro?) I never understood why you guys deviated from that - is it really fair that I have to pay for C#, VB and whatever other .Net language is in VS Pro when I have no use for them? It's like being forced to buy the Godfather boxset when all I want is I and II. (Clarification: I'm not saying C#/VB quality = Godfather III quality, I'm simply saying I don't use them)


    MFC - I think it's the best c++ option when you want an app that looks and feels like a Windows app. As others have said, the big problem is the code feels too non-standardish and outdated. I think even Qt suffers from this, but not quite to the same extent. It would be great to see std::containers, algorithms, etc. used in the MFC library, as well as some refactoring to use some of the current popular design patterns. (say, MVC)


    C++0x - My guess is that it will be a good 3+ years before you can write code that's truly transparent across the major platforms/compilers, and I don't really see the point in writing C++0x based code until then. (I can get by with current standard + boost for now)


    But, since you are looking for input, the items I prefer from the new standard are the ones that decrease verbosity - initializer lists, range-based for loops, constructors calling other constructors, data member initialization, etc. The less typing, the better IMO.