Scott Meyers' Effective STL :: C++

This is a discussion on Scott Meyers' Effective STL :: C++ within the C++ Programming forums, part of the General Programming Boards category; Hi. I am studying more advanced C++ via Scott Meyer's Effective STL. I have not read any of his previous ...

  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-24-2008, 12:38 AM
  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-24-2004, 12:22 AM
  4. Prime Number Generator... Help !?!!
    By Halo in forum C++ Programming
    Replies: 9
    Last Post: 10-20-2003, 08:26 PM
  5. include question
    By Wanted420 in forum C++ Programming
    Replies: 8
    Last Post: 10-17-2003, 04:49 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21