Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. Boost

Boost

Scheduled Pinned Locked Moved ATL / WTL / STL
comquestionlearning
14 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    I took the plunge. One word - 'Wow!'. What a fantastic library! Can anyone give me some quick Boost recommendations? So far I have used list_of(), indirect_iterator, tokenizer, trim and, of course, shared_ptr. What are your favourite Boost libs?


    The Rob Blog

    N G S J N 5 Replies Last reply
    0
    • L Lost User

      I took the plunge. One word - 'Wow!'. What a fantastic library! Can anyone give me some quick Boost recommendations? So far I have used list_of(), indirect_iterator, tokenizer, trim and, of course, shared_ptr. What are your favourite Boost libs?


      The Rob Blog

      N Offline
      N Offline
      Nemanja Trifunovic
      wrote on last edited by
      #2

      Robert Edward Caldecott wrote: 'Wow!'. What a fantastic library! Agree 100%. Robert Edward Caldecott wrote: Can anyone give me some quick Boost recommendations? It really depends on the nature of your projects. I am currently involved with text processing libraries, and thus mostly use regex, lexical_cast and tokanizer, and looking forward to using string_algo. Also, I make a heavy use of smart pointers, tuple and test, and to a lesser extent filesystem, bind and graph.


      My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.

      1 Reply Last reply
      0
      • L Lost User

        I took the plunge. One word - 'Wow!'. What a fantastic library! Can anyone give me some quick Boost recommendations? So far I have used list_of(), indirect_iterator, tokenizer, trim and, of course, shared_ptr. What are your favourite Boost libs?


        The Rob Blog

        G Offline
        G Offline
        guypremont
        wrote on last edited by
        #3

        I'm also a Boost addict... ;) You should definitely take a look at boost::bind and boost::signal, I use them all the time. I recently started using boost::serialization and boost::regex. Both are simple to use and extremely powerful.

        1 Reply Last reply
        0
        • L Lost User

          I took the plunge. One word - 'Wow!'. What a fantastic library! Can anyone give me some quick Boost recommendations? So far I have used list_of(), indirect_iterator, tokenizer, trim and, of course, shared_ptr. What are your favourite Boost libs?


          The Rob Blog

          S Offline
          S Offline
          Stuart Dootson
          wrote on last edited by
          #4

          Practically: regex, bind (oh, yeah!), shared_ptr, string_algo, signals, function, tuple, variant, optional From a 'wow' point of view: lambda, spirit. I've also started using Boost.Test for unit testing - :cool: Just one thing - if you're not using VC7.1, try and do so - you'll be doing yourself a favour...

          L 1 Reply Last reply
          0
          • S Stuart Dootson

            Practically: regex, bind (oh, yeah!), shared_ptr, string_algo, signals, function, tuple, variant, optional From a 'wow' point of view: lambda, spirit. I've also started using Boost.Test for unit testing - :cool: Just one thing - if you're not using VC7.1, try and do so - you'll be doing yourself a favour...

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Yeh, bind. Very useful. I have been using containers of shared_ptr's, and it is so cool that I can do something like:

            class CFoo
            {
            ...
            void fn(int n, std::string str)
            {
            // Do something
            }
            };

            ...

            std::vector<boost::shared_ptr<CFoo> > v;
            v.push_back(boost::shared_ptr<CFoo>(new CFoo));
            ...
            for_each(v.begin(), v.end(), boost::bind(&CFoo::fn, _1, 1234, "Boost!"));

            Splendid. Using boost::bind for std::find_if is also very useful. So much to learn...

            C 1 Reply Last reply
            0
            • L Lost User

              I took the plunge. One word - 'Wow!'. What a fantastic library! Can anyone give me some quick Boost recommendations? So far I have used list_of(), indirect_iterator, tokenizer, trim and, of course, shared_ptr. What are your favourite Boost libs?


              The Rob Blog

              J Offline
              J Offline
              Joaquin M Lopez Munoz
              wrote on last edited by
              #6

              Boost.MPL[^] is an impressive achievement and a mind-opener for those venturing into the world of C++ metaprogramming. I wonder, however, how much real use metaprogramming gets in the C++ community. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo Want a Boost forum in Code Project? Vote here[^]!

              N 1 Reply Last reply
              0
              • J Joaquin M Lopez Munoz

                Boost.MPL[^] is an impressive achievement and a mind-opener for those venturing into the world of C++ metaprogramming. I wonder, however, how much real use metaprogramming gets in the C++ community. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo Want a Boost forum in Code Project? Vote here[^]!

                N Offline
                N Offline
                Nemanja Trifunovic
                wrote on last edited by
                #7

                Here[^] is a very interesting example of use of Boost MPL.


                My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.

                1 Reply Last reply
                0
                • L Lost User

                  Yeh, bind. Very useful. I have been using containers of shared_ptr's, and it is so cool that I can do something like:

                  class CFoo
                  {
                  ...
                  void fn(int n, std::string str)
                  {
                  // Do something
                  }
                  };

                  ...

                  std::vector<boost::shared_ptr<CFoo> > v;
                  v.push_back(boost::shared_ptr<CFoo>(new CFoo));
                  ...
                  for_each(v.begin(), v.end(), boost::bind(&CFoo::fn, _1, 1234, "Boost!"));

                  Splendid. Using boost::bind for std::find_if is also very useful. So much to learn...

                  C Offline
                  C Offline
                  CP Visitor
                  wrote on last edited by
                  #8

                  Robert Edward Caldecott wrote:_

                  std::vector > v;
                  v.push_back(boost::shared_ptr(new CFoo));...
                  for_each(v.begin(), v.end(), boost::bind(&CFoo::fn, _1, 1234, "Boost!"));

                  _And you call that cool?? I mean, seriously? :~ Well, there's no accounting for taste.

                  L 1 Reply Last reply
                  0
                  • C CP Visitor

                    Robert Edward Caldecott wrote:_

                    std::vector > v;
                    v.push_back(boost::shared_ptr(new CFoo));...
                    for_each(v.begin(), v.end(), boost::bind(&CFoo::fn, _1, 1234, "Boost!"));

                    _And you call that cool?? I mean, seriously? :~ Well, there's no accounting for taste.

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    You don't think smart pointers are useful? You don't think for_each is useful? Aaahh ... I see from previous posts that you actually think STL is "bloatware". What a shame. Other than the fact that both STL and Boost are incredibly powerful, I need to write code for Windows AND Linux, and without these libraries, this would be difficuly to achieve.

                    C 1 Reply Last reply
                    0
                    • L Lost User

                      You don't think smart pointers are useful? You don't think for_each is useful? Aaahh ... I see from previous posts that you actually think STL is "bloatware". What a shame. Other than the fact that both STL and Boost are incredibly powerful, I need to write code for Windows AND Linux, and without these libraries, this would be difficuly to achieve.

                      C Offline
                      C Offline
                      CP Visitor
                      wrote on last edited by
                      #10

                      Robert Edward Caldecott wrote: You don't think smart pointers are useful? I think, somebody who puts pointers or smart pointers into a std container has not understood one basic principle of STL, that is, 'value semantics'. What a shame. Other than the fact that both STL and Boost are incredibly powerful, I need to write code for Windows AND Linux, and without these libraries, this would be difficuly to achieve. It's ok if it works for you. IMO, it's not really elegant that one has to write

                      v.push_back(boost::shared_ptr(new CFoo));

                      to insert an element.

                      L 1 Reply Last reply
                      0
                      • C CP Visitor

                        Robert Edward Caldecott wrote: You don't think smart pointers are useful? I think, somebody who puts pointers or smart pointers into a std container has not understood one basic principle of STL, that is, 'value semantics'. What a shame. Other than the fact that both STL and Boost are incredibly powerful, I need to write code for Windows AND Linux, and without these libraries, this would be difficuly to achieve. It's ok if it works for you. IMO, it's not really elegant that one has to write

                        v.push_back(boost::shared_ptr(new CFoo));

                        to insert an element.

                        L Offline
                        L Offline
                        Lost User
                        wrote on last edited by
                        #11

                        CP Visitor wrote: It's ok if it works for you. IMO, it's not really elegant that one has to write Why not? You could always use typedef:

                        typedef boost::shared_ptr<CFoo> foo_sp;
                        ...
                        v.push_back(foo_sp(new CFoo));

                        Elegant enough IMO, though people seem to either love or hate typedef. Using smart pointers in containers is very useful, and from experience, it has meant more time concentrating on the job at hand instead of tracking down memory leaks. I did use the ATL7 CAutoPtr class (and associated CAtlArray/CAtlList) but that's no help for writing portable code plus I prefer using STL iterators over MFC's 'POSITION' scheme. Shrug. Whatever works I guess. But the more I use STL/Boost, the more I wonder why I went so long without it! :-)

                        1 Reply Last reply
                        0
                        • L Lost User

                          I took the plunge. One word - 'Wow!'. What a fantastic library! Can anyone give me some quick Boost recommendations? So far I have used list_of(), indirect_iterator, tokenizer, trim and, of course, shared_ptr. What are your favourite Boost libs?


                          The Rob Blog

                          N Offline
                          N Offline
                          Nish Nishant
                          wrote on last edited by
                          #12

                          Is Boost a full STL implementation? If so, won't some of the classes clash with VC++'s STL classes? Or are the Boost classes in a different namespace?

                          S 1 Reply Last reply
                          0
                          • N Nish Nishant

                            Is Boost a full STL implementation? If so, won't some of the classes clash with VC++'s STL classes? Or are the Boost classes in a different namespace?

                            S Offline
                            S Offline
                            Stuart Dootson
                            wrote on last edited by
                            #13

                            Nishant Sivakumar wrote: Is Boost a full STL implementation? No - it's not an STL implementation at all...apart from some of the things that are added at TR1 (like regex, smart pointers, function and some other stuff) and are so are not yet in any STL that you'll have access to). Really, if you consider Boost as a sandpit for libraries that are or could be potential additions to the Standard C++ library, you're not far wrong. Also - Boost classes are all in the boost namespace or a child namespace of boost.

                            N 1 Reply Last reply
                            0
                            • S Stuart Dootson

                              Nishant Sivakumar wrote: Is Boost a full STL implementation? No - it's not an STL implementation at all...apart from some of the things that are added at TR1 (like regex, smart pointers, function and some other stuff) and are so are not yet in any STL that you'll have access to). Really, if you consider Boost as a sandpit for libraries that are or could be potential additions to the Standard C++ library, you're not far wrong. Also - Boost classes are all in the boost namespace or a child namespace of boost.

                              N Offline
                              N Offline
                              Nish Nishant
                              wrote on last edited by
                              #14

                              Thanks, Stuart.

                              1 Reply Last reply
                              0
                              Reply
                              • Reply as topic
                              Log in to reply
                              • Oldest to Newest
                              • Newest to Oldest
                              • Most Votes


                              • Login

                              • Don't have an account? Register

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • World
                              • Users
                              • Groups