CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

difference between const dictionary and const dictionary&

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 8, 2018, 11:26
Exclamation difference between const dictionary and const dictionary&
  #1
Member
 
Mankaran Dhiman
Join Date: Jun 2017
Posts: 34
Rep Power: 9
mankaran90 is on a distinguished road
Hey ppl

Can anyone tell me whats the difference between const dictionary and const dictionary&
mankaran90 is offline   Reply With Quote

Old   January 8, 2018, 12:09
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
First case you pass a copy of the dictionary, second case you pass a reference.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   January 8, 2018, 13:20
Default
  #3
Member
 
Mankaran Dhiman
Join Date: Jun 2017
Posts: 34
Rep Power: 9
mankaran90 is on a distinguished road
Thanks. Is there any difference between writing
const dictionary& dict and. const dictionary &dict ?
mankaran90 is offline   Reply With Quote

Old   January 22, 2018, 19:07
Default
  #4
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
No there is no differences. You also can write
Code:
const dicstionary       &              dict = ...
Whitespaces are not counted.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   February 2, 2018, 05:32
Default
  #5
Member
 
Mankaran Dhiman
Join Date: Jun 2017
Posts: 34
Rep Power: 9
mankaran90 is on a distinguished road
Thanks Tobi
mankaran90 is offline   Reply With Quote

Reply

Tags
dictionary, openfoam, programming


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Temperature variations to Density in interFoam spitchers OpenFOAM Running, Solving & CFD 7 June 15, 2017 11:55
undefined reference to a C++'s class member function linyanx OpenFOAM Programming & Development 5 May 12, 2017 13:44
[blockMesh] error message with modeling a cube with a hold at the center hsingtzu OpenFOAM Meshing & Mesh Conversion 2 March 14, 2012 10:56
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 07:51
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 15:00


All times are GMT -4. The time now is 10:00.