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 Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 8, 2018, 10:26
Exclamation difference between const dictionary and const dictionary&
  #1
Member
 
Mankaran Dhiman
Join Date: Jun 2017
Posts: 34
Rep Power: 6
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, 11:09
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,379
Rep Power: 27
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, 12:20
Default
  #3
Member
 
Mankaran Dhiman
Join Date: Jun 2017
Posts: 34
Rep Power: 6
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, 18:07
Default
  #4
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Augsburg
Posts: 2,567
Blog Entries: 6
Rep Power: 46
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, 04:32
Default
  #5
Member
 
Mankaran Dhiman
Join Date: Jun 2017
Posts: 34
Rep Power: 6
mankaran90 is on a distinguished road
Thanks Tobi
mankaran90 is offline   Reply With Quote

Reply

Tags
dictionary, openfoam, programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 10:55
undefined reference to a C++'s class member function linyanx OpenFOAM Programming & Development 5 May 12, 2017 12:44
[blockMesh] error message with modeling a cube with a hold at the center hsingtzu OpenFOAM Meshing & Mesh Conversion 2 March 14, 2012 09:56
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 06:51
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 14:00


All times are GMT -4. The time now is 01:19.