Thread: Scott Meyers' Effective STL :: C++

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348

    Scott Meyers' Effective STL :: C++

    Hi.

    I am studying more advanced C++ via Scott Meyer's Effective STL. I have not read any of his previous books including the C++ series. He does an exceptional job introducing invaluable advices on the use of STL. I am still reading it.

    He makes references to a term that I am not familiar with. He mentions "reference counting" about vector and string containers. What is it?

    Thanks,
    Kuphryn

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    The concept of the reference count is simply to share chunks of data between objects by keeping a count of how many are using it. When no more objects refer to that memory, the chunk is released.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Okay. Thanks.

    Kuphryn

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Why Scott Meyers wants you to slap yourself?
    By meili100 in forum C++ Programming
    Replies: 5
    Last Post: 10-23-2008, 11:38 PM
  2. C Formatting Using STL
    By ChadJohnson in forum C++ Programming
    Replies: 4
    Last Post: 11-18-2004, 05:52 PM
  3. im extreamly new help
    By rigo305 in forum C++ Programming
    Replies: 27
    Last Post: 04-23-2004, 11:22 PM
  4. Prime Number Generator... Help !?!!
    By Halo in forum C++ Programming
    Replies: 9
    Last Post: 10-20-2003, 07:26 PM
  5. include question
    By Wanted420 in forum C++ Programming
    Replies: 8
    Last Post: 10-17-2003, 03:49 AM