473,320 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

What does the ":" mean in the following statement?

class FloatingLeg
{
public:
FloatingLeg(map<double, double> floatLegRate, double floatLegBasis, int payFrequency)
:floatLegRate_(floatLegRate), floatLegBasis_(floatLegBasis), payFrequency_(payFrequency){}

....}
Dec 17 '10 #1
2 1512
hype261
207 100+
Jennifer,

What you are looking at there is an initialization list.

The class has member variables called

floatLegReate_, floatLegBasis_ , and payFrequency_

What you are doing is initializing these member variables to the arguments sent into the constructor. This way of constructing your class is more efficient than doing this.

Expand|Select|Wrap|Line Numbers
  1. class FloatingLeg
  2. {
  3. public:
  4. FloatingLeg(map<double, double> floatLegRate, double floatLegBasis, int payFrequency)
  5. {
  6. floatLegRate_ = floatLegRate;
  7. floatLegBasis_ = floatLegBasis;
  8. payFrequency_ = payFrequency;
  9. }
  10. }; 
  11.  
  12.  
  13.  
  14.  
Dec 18 '10 #2
Understood. Thank you very much.
Dec 18 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Steve Richter | last post by:
What does the "." mean in the following sql script stmts? use GO if exists (select * from dbo.sysobjects where id = object_id(N'.') and OBJECTPROPERTY(id,N'IsUserTable') = 1) drop table ....
3
by: RobertTG | last post by:
Someone please translate the code below into English... Particularly the indicated line Thanks function attachComment() { var aForms = document.getElementsByTagName("FORM"); for (var i = 0;...
6
by: allenj | last post by:
DB21085I Instance "md" uses "32" bits and DB2 code release "SQL08012" with level identifier "02030106". Informational tokens are "DB2 v8.1.0.16", "s030508", "MI00048", and FixPak "2". Product is...
58
by: Larry David | last post by:
Ok, first of all, let's get the obvious stuff out of the way. I'm an idiot. So please indulge me for a moment. Consider it an act of "community service".... What does "64bit" mean to your friendly...
3
by: Mike Hamilton | last post by:
Hi newsgroup, I have a C# code that I tried to convert to VB.NET using a snippet converter. The converter produced something I don't understand, namely: <Config("Camera", "cameraType")_...
92
by: Heinrich Pumpernickel | last post by:
what does this warning mean ? #include <stdio.h> int main() { long l = 100; printf("l is %li\n", l * 10L);
45
by: loudking | last post by:
Hello, all I don't quite understand what does ((time_t)-1) mean when I execute "man 2 time" RETURN VALUE On success, the value of time in seconds since the Epoch is retu rned. On error,...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.