Search code examples
c++boost

How do I get started using Boost?


I hear a lot about Boost here and I am beginning to think it could help a lot with my software development. More so in concurrency and memory management in my particular case as we have had a lot of bugs in this area.

What are the key language features I need to polish up on to effectively benefit from using boost and to shorten the learning curve? I have seen that function objects are commonly used so I would probably need to polish up on that.

Additionally, are there any tutorials and 101 resources I can quickly look at to just get a feel and understanding on using boost.

I realise there is a lot Boost offers, and I have to pick the right tools for the right job, but any leads will help.

Related


Solution

  • Boost has an unimaginable number of libraries. Easy ones to get started on are

    • noncopyable
    • array
    • circular_buffer
    • foreach
    • operators (one of my personal favorites)
    • smart_ptr
    • date_time

    More advanced ones include

    • lambda
    • bind
    • iostreams
    • serialization
    • threads

    Getting used to Boost takes time, but I assure you it will make your life much better. Plus, looking at how the Boost libraries are coded will help you get better at C++ coding, especially templates.

    You mentioned what should you look up before trying boost. I agree that function objects are a great thing to research. Also, make sure to look up about template programming. A common problem to make sure you know is when to use the typename qualifier for dependent types. For the most part, however, the libraries are very well documented, with examples and reference materials.