c++ initialisation lists

Despite having coded in c++ for a several years, I looked at this and thought ?!?. It turns out that this is an obscure, but perfectly valid c++ construct, an initialisation list.

// TCP digest calculation
 
TCPDigest::TCPDigest (DigestAlgorithm *alg_to_use, SigKey &key):
        counter(0),
        alg (alg_to_use ? alg_to_use->clone( key ):
                          new HMAC_MD5_Algorithm (key)),
        key (key)
        // here request signatre should be taken to digest
{
}

It's primary purpose is to allow the developer to choose which superclass constructors would be called, and with what parameters (especially in the case of multiple inheritance). The initialisation list can also assign values to member variables, by using pseudo functions having the same name as the member variables. i.e. the above code assigns a value of 0 to counter.

The driving force in using an initialisation list in this source was that it is a valid way of initialising class members which are references, rather than normal variables. (In this case 'key' is declared foo &key; in the header).)

Comments

Real Estate | Homes | 3.5%

Real Estate | Homes | 3.5% FHA | Mortgage | Houses | 100% VA | Homes For Sale | Realtors | Zero Down USDA | Lincoln Home | Oakland Home | Half Percent Down | Anaheim Home | Orange House | 203 K FHA | Richmond Realtors | Sacramento Houses | Conventional Loans | Orange Houses | San Jose Houses | Jumbo Loans | Auburn Home | Highland Home | City Down Payment | Fairfield Home | Lafayette Home | 2yr BK Discharge OK | Sacramento Realtors | Irvine Home | <620 FICO with No 12 mo lates | Pasadena Home | Santa Ana Homes | 620+ FICO Ok | Corona Home | Santa Monica Homes | 6% Seller Credit OK | Anaheim Homes For Sale | Burbank Homes | 30 Yr Fixed | Elk Grove Homes | Newark Homes For Sale | 15 Yr Fixed | Newark Houses | Long Beach Houses | 20 Yr Fixed | San Jose Realtors | Dublin Home | 5 Yr Adjustable | Walnut Creek Real Estate | Fremont Home | 7 Yr Adjustable | Lincoln Houses | Modesto Homes | 10 Yr Adjustable

assa

Thank you very much for this useful article. I like it.
sohbetsohbet
cinsel sohbetcinsel sohbet
sicak sohbetsıcak sohbet
cinsel sohbet
sex sohbet
güzel kızlar
sohbet
Thank you very much for this useful article. I like it.
chatchat
kelebekkelebek
kelebek sohbetkelebek sohbet
sohbetsohbet
sohbet kanallarısohbet kanalları
chat odasıchat odası
kelebek chatkelebek chat
kelebek scriptkelebek script
chatchat