
nakkal vagalane

see + + sanganak programingmadhye, coppy eligion mhanje sankalak optimization tantra jeey vastoonchya anavashyak coppy karane kadhoon takte.
see + + bhasha manak samanyatah amalbajavanila konatehi optimization karanyachi parvanagi dete, jarr parinami programche nirikshan karnyayogya vartan "jarr asel" sarkhech asel tarr.eae. asey bhasavat, mankane anivarya kelyapramane karyakram karyanvit keela gela. tyapalikade, manak kahee paristhitinche dekhil varnan karate jithe coppy karane kadhoon takale jaau shakate jaree yamule programche vartan badalale asale, tarr sarvat samanya mhanje paratava moolya optimization (khalee pahaa). see + + mankamadhye varnan kelele aanakhi eka vyapakpane karyanvit kelele optimization mhanje jevha varg prakarachi tatpurati vastoo tyach prakarchya vastuvar coppy kelee jaate.<sandarbh naav = "see + + 03 12.8/15"> iso/iec (2003). "aay. ess. oo./aay. eae. see. <aay. dii. 1> (eae.): programming bhasha-see + + §12.8 varg objectchi [varg] nakkal karat aahe.prat] "parra. 15 parinami, "coppy-initialization" heey sahasa kamgirichya drushtine "direct-initialization" chya samatulya asate, parantu shabdarthshastrat nahee; "coppy-initialization" sathee ajunahi sulabh coppy constructorchi aavashyakta asate. sandarbhala bandhalelya tatpuratya vastuvar optimization lagoo kele jaau shakat nahee.
udaharanadakhal.
int aine = 0;
sanrachana see {
 see (const see &) {+ + aine;}// coppy constructorcha drishyaman dushparinam aahe
};// heey sthir sathavan kalavadhisah objectmadhye badal karate
int maine () {
 see see 1 (42);// thet-prarambh, seeh see (int)
 c c2 = c (42);// pratilipi-prarambh, c:: c (sthirank c &) asey mhanatat
 ess. tii. dii.:: cout "n" ess. tii. dii.:: endall;// print 0 jarr prat vagalali gelee asel tarr, anyatha 1
mankannusar fekalya jaananya aanee pakadalya jaananya vastunvar samaan optimization lagoo kele jaau shakate, <ref naav = "c + + 03 15.1/5> iso/iec (2003). "aay. ess. oo./aay. eae. see. <aay. dii. 1> (eae.): programming bhasha-see + + §15.1 apavad dett aahe [apavad vagalata.fekane] "parra. 5 </ref> <ref naav = "see + + 03 15.3/17"> iso/iec (2003). "aay. ess. oo./aay. eae. see. <aay. dii. 1> (eae.): programming bhasha-see + + §15.3 apavad hataltana [apavad vagalata.handle] "parra. 17 parantu fekalelya vastupasoon 'apavad vastoo' paryantchya pratila aanee 'apavad vastoo' pasoon 'catch clodge' chya 'apavad-ghoshane' madhye ghoshit kelelya vastoochya pratila optimization lagoo hote qee nahee heey spasht nahee. heey optimization keval tatpuratya vastoonna lagoo hote qee naav dilelya vastoonna dekhil lagoo hote heey dekhil aspasht aahe. khaleel srot code deela aaheh
sanrachana see {
 c () = purvanirdharit;
shoonya eff () {
 see see;
 see;// navachya vastuchi see. madhye apavad vastumadhye prat fekane.
} //hii prat vagalali jaau shakate qee nahee heey spasht nahee (vagalale).
int maine () {
 prayatna qaraa {
 eff ();
 } pakadane (see see) {// apavad vastuchi tatpuratya swarupat nakkal karane
 //apavad ghoshana.
 }// hii prat vagalali jaau shakate qee nahee heey dekhil aspasht aahe (vagalale).
tyamule anuroop compilerne eka program tayar keela pahije joou "hallow world!" chhapato."donada. see + + manak (see + + 11) chya sadhyachya punaravruttimadhye, samasyanche nirakaran kele gele aahe, jyamule moolatah naav dilelya vastuchi prat apavad vastushi aanee apavad hatalkamadhye ghoshit kelelya vastuchi prat vagalali jaau shakate.
jee. see. see. coppy-eligion aksham karnyasathi cocksey _ 1 paryay pradan karate. paratava moolya optimization kinwa itar optimization parinam pahanyasathi (kinwa nirikshan naan karnyasathi) haah paryay upayukt aahe jethe pratee vagalalya jaatat. heey mahattvache optimization samanyatah aksham karanyachi shifaras kelee jaat nahee.
paratava moolya anukulan.
see + + programming bhashechya sandarbhat, return value optimization (aar. vhee. oo.) heey eka sankalak optimization aahe jyamadhye functionche return moolya dharan karnyasathi tayar keleli tatpurati vastoo kadhoon takane samavisht aahe. aar. vhee. oo. laa see + + mankadware parinami karyakramache nirikshan karnyayogya vartan badalanyachi parvanagi aahe.
saransh.
sarvasadharanpane, see + + manak sankalkala konatehi optimization karanyachi parvanagi dete, jarr parinami karyanvit karnyayogya samaan nirikshanksham vartan "jase" (i.eae. dhong karoon) manakachya serve aavashyakta purn kelya gelya aahet. yala samanyatah 'aij-iff ruul' asey sambodhale jaate.<sandarbh naav = "see + + 03 1.9/1"> iso/iec (2003). "aay. ess. oo./aay. eae. see. <aay. dii. 1> (eae.): programming bhasha-see + + § 1.9 program amalbajavani [parichay.amalbajavani] "parra. 1 'paratava moolya anukulata' haah shabd see + + mankatil eka vishesh kalamacha sandarbh deto joou 'jase asel tase' niyamapeksha aanakhi pudhe jaatoh amalbajavani paratavyachya vidhanamule honare prat operation vagaloo shakate, jaree prat nirmatyache dushparinam asale tarihi.<sandarbh naav = "see + + 03 12.8/15"> iso/iec (2003). "aay. ess. oo./aay. eae. see. <aay. dii. 1> (eae.): programming bhasha-see + + §12.8 varg objectchi [varg] nakkal karat aahe.prat] "parra. 15 </ref>
khaleel udaharan eka ashee paristhiti darshavate jithe amalbajavani kelee jaanari eka kinwa donhi pratee kadhoon takoo shakate, jaree coppy constructorcha drishyaman dushparinam (mudran majkoor) asala tarihi. vagalali jaau shakanari pahili prat mhanje jithe navheen tatpurati cocksey _ 2 hii cocksey _ 3 chya paratavyachya moolyat coppy kelee jaau shakate. kadhoon takali jaau shakanari dusari prat mhanje cocksey _ 3 neey cocksey _ 5 laa parat kelelya tatpuratya vastuchi prat.
sanrachana see {
 c () = purvanirdharit;
see eff () {
 parat qaraa see ();
int maine () {
 stdh 'hallow world!\aine ";
 c oo. bii. jeey. = eff. ();
sankalak aanee tyaa sankalakchya settingjanusar, parinami program khalilpaiki konatihi output pradarshit karoo shakatoh
parshvabhoomi.
ekhadya karyatoon antarnirmit prakarchi vastoo parat karane sahasa qamee kinwa konatehi overhead nasate, kaaran vastoo samanyatah see. pii. yuu. nondanimadhye basate. varg prakarchya mothya vastoola parat karnyasathi eka smrutee sthanavarun dusya smrutee sthanavar adhik mahag prat karane aavashyak asoo shakate. heey talhanyasathi, amalbajavani coll karnanyachya stack framemadhe eka lapaleli vastoo tayar karoo shakate aanee yaa vastoocha patta karyat pathvu shakate. tyanantar functionche paratava moolya lapalelya objectmadhye coppy kele jaate. asha prakare, asha kodah
sanrachana mahitee { 
 chaar bites [16]; 
deta eff () {
 deta parinam = {};
 //parinam nirman qaraa
 paratava parinam;
int maine () {
 deta dii = eff ();
yachya samatulya code tayar karoo shakatoh
sanrachana mahitee {
 chaar bites [16];
deta * eff (deta * _ lapalela patta) {
 deta parinam = {};
 //parinam lapalelya objectmadhye coppy qaraa
 *gupt patta = parinam;
 parat pathva (_ h) gupt patta;
int maine () {
 deta _ hiddon;// hiddon object tayar qaraa
 deta d = * f (& _ hiddon);// nikal dii madhye coppy qaraa
jyamule cocois _ 6 objectchi donada nakkal kelee jaate.
see + + chya utkrantichya suruvatichya tappyat, ekhadya karyatoon varg prakarchya vastoola karyakshamatene parat karanyachi bhashechi asamarthata hii eka kamjori manali jaat asey. 1991 chya sumaras, walter britene nakkal qamee karnyasathi eka tantra lagoo kele, parinam dharan karnyasathi vaparlya jaanarya objects karyatil lapaleli vastoo aanee navachya objectchi prabhavipane jaaga ghetalih
sanrachana mahitee {
 chaar bites [16];
shoonya eff (deta * pii) {
 //thet pii madhye parinam nirman qaraa
int maine () {
 deta dii;
 eff (& dii);
britene tyachya zortech see + + compilermadhye heey optimization lagoo kele. heey vishisht tantra nantar 'return value optimization' (aine. aar. vhee. oo.) mhanoon tayar karnyat aale, jeey navachya vastuchi nakkal vagalali jaate yaa vastusthiticha sandarbh dete.
sankalak samarthan.
bahutek sankalkanvar paratava moolya optimization samarthit aahe. 
tathapi, ashee paristhiti asoo shakate jithe sankalak optimization karoo shakat nahee. eka samanya prakaran mhanje jevha ekhade karya amalbajavanichya marganusar vegvegalya naav asalelya vastoo parat karoo shakateh
stdh string eff (bool conned = chukiche) {
 stdh string first ("first");
 stdh string sekand ("sekand");
 //karya done naav asalelya vastunpaiki eka parat karoo shakate
 //tyachya yuktivadavar avalambun asate. aar. vhee. oo. lagoo keela jaanar nahee
 parat qaraa? pahilah dusra;
int maine () {
 stdh string parinam = eff ();