SlideShare una empresa de Scribd logo
1 de 1
Descargar para leer sin conexión
Question #13 Consider a simple class for wrapping a file descriptor. What are the minimal
change(s) that would be required to make the class: 1. hard to accidentally misuse (e.g. causing
an invalid or undesired file descriptor to be closed), and 2. usable as a return value from a
function? 1. Adding a custom move constructor and move assignment operator.
Filedescriptor(filenescriptorss chs) noexcept : fd_(rhs.fd_) f rhs.fd_ =1; i Filedescriptors
operator-(FiloDescriptorss chs) noexcept f using std: :swap; swap(fd, rhs. Fd_); return wthis; 2.
Adding a custom copy constructor and copy assignment operator: Filedescriptor(Filedescrintor
consts rhs) : fd_(rhs.fo_) [) Filedescriptors operator- (FileDoscriptor consts rhs) t fd_- rhs.fd-;
feturn *this; J 3. Disabling the copy constructor and copy assignment operator:
F11eDescriptor(FileDescriptor consts) - delete; Filedescriptars operator-(Filedescriptor consts) -
delete; 4. Disabling the move constructor and move assignment operator:
F11cDescriptor(FiloDescriptorss)=de1ete;F11eDescriptorsoperator-(F11edescriptors8)=delete;
5. Adding default implementations of the move constructor and move assignment operator:
Filedescriptor(Filedescrtptarss) - defau1t; FlieDescriptors operator-(FileDescriptonss) - default;

Más contenido relacionado

Similar a Question #13 Consider a simple class for wrapping a file descriptor..pdf

Unix.system.calls
Unix.system.callsUnix.system.calls
Unix.system.callsGRajendra
 
linux commands.pdf
linux commands.pdflinux commands.pdf
linux commands.pdfamitkamble79
 
101 2.3 manage shared libraries
101 2.3 manage shared libraries101 2.3 manage shared libraries
101 2.3 manage shared librariesAcácio Oliveira
 
6 preprocessor macro header
6 preprocessor macro header6 preprocessor macro header
6 preprocessor macro headerhasan Mohammad
 
SECR'13 Lightweight linux shared libraries profiling
SECR'13 Lightweight linux shared libraries profilingSECR'13 Lightweight linux shared libraries profiling
SECR'13 Lightweight linux shared libraries profilingOSLL
 
Programming Embedded linux
Programming Embedded linuxProgramming Embedded linux
Programming Embedded linuxLiran Ben Haim
 
Hadoop Interacting with HDFS
Hadoop Interacting with HDFSHadoop Interacting with HDFS
Hadoop Interacting with HDFSApache Apex
 
Kernel Recipes 2019 - Kernel documentation: past, present, and future
Kernel Recipes 2019 - Kernel documentation: past, present, and futureKernel Recipes 2019 - Kernel documentation: past, present, and future
Kernel Recipes 2019 - Kernel documentation: past, present, and futureAnne Nicolas
 
2.3 manage shared libraries
2.3 manage shared libraries2.3 manage shared libraries
2.3 manage shared librariesAcácio Oliveira
 
Operating System Laboratory presentation .ppt
Operating System Laboratory presentation .pptOperating System Laboratory presentation .ppt
Operating System Laboratory presentation .pptPDhivyabharathi2
 
LSOF Command Usage on RHEL 7
LSOF Command Usage on RHEL 7LSOF Command Usage on RHEL 7
LSOF Command Usage on RHEL 7VCP Muthukrishna
 
Reproducibility with R
Reproducibility with RReproducibility with R
Reproducibility with RMartin Jung
 

Similar a Question #13 Consider a simple class for wrapping a file descriptor..pdf (20)

Unix.system.calls
Unix.system.callsUnix.system.calls
Unix.system.calls
 
linux commands.pdf
linux commands.pdflinux commands.pdf
linux commands.pdf
 
101 2.3 manage shared libraries
101 2.3 manage shared libraries101 2.3 manage shared libraries
101 2.3 manage shared libraries
 
6 preprocessor macro header
6 preprocessor macro header6 preprocessor macro header
6 preprocessor macro header
 
Linux IO
Linux IOLinux IO
Linux IO
 
SECR'13 Lightweight linux shared libraries profiling
SECR'13 Lightweight linux shared libraries profilingSECR'13 Lightweight linux shared libraries profiling
SECR'13 Lightweight linux shared libraries profiling
 
Programming Embedded linux
Programming Embedded linuxProgramming Embedded linux
Programming Embedded linux
 
40 basic linux command
40 basic linux command40 basic linux command
40 basic linux command
 
40 basic linux command
40 basic linux command40 basic linux command
40 basic linux command
 
Hadoop Interacting with HDFS
Hadoop Interacting with HDFSHadoop Interacting with HDFS
Hadoop Interacting with HDFS
 
Solaris basics
Solaris basicsSolaris basics
Solaris basics
 
Kernel Recipes 2019 - Kernel documentation: past, present, and future
Kernel Recipes 2019 - Kernel documentation: past, present, and futureKernel Recipes 2019 - Kernel documentation: past, present, and future
Kernel Recipes 2019 - Kernel documentation: past, present, and future
 
2.3 manage shared libraries
2.3 manage shared libraries2.3 manage shared libraries
2.3 manage shared libraries
 
Operating System Laboratory presentation .ppt
Operating System Laboratory presentation .pptOperating System Laboratory presentation .ppt
Operating System Laboratory presentation .ppt
 
abc12
abc12abc12
abc12
 
popopo
popopopopopo
popopo
 
abc
abcabc
abc
 
C Programming Unit-5
C Programming Unit-5C Programming Unit-5
C Programming Unit-5
 
LSOF Command Usage on RHEL 7
LSOF Command Usage on RHEL 7LSOF Command Usage on RHEL 7
LSOF Command Usage on RHEL 7
 
Reproducibility with R
Reproducibility with RReproducibility with R
Reproducibility with R
 

Más de AlphaVision2

Question content area top Part 1 Weights (kg) of poplar trees were o.pdf
Question content area top Part 1 Weights (kg) of poplar trees were o.pdfQuestion content area top Part 1 Weights (kg) of poplar trees were o.pdf
Question content area top Part 1 Weights (kg) of poplar trees were o.pdfAlphaVision2
 
QUESTION 7 Buffleheads are small diving ducks that primarily eat aqu.pdf
QUESTION 7 Buffleheads are small diving ducks that primarily eat aqu.pdfQUESTION 7 Buffleheads are small diving ducks that primarily eat aqu.pdf
QUESTION 7 Buffleheads are small diving ducks that primarily eat aqu.pdfAlphaVision2
 
Question-1 (courier Services) As an employee of a large courier and .pdf
Question-1 (courier Services) As an employee of a large courier and .pdfQuestion-1 (courier Services) As an employee of a large courier and .pdf
Question-1 (courier Services) As an employee of a large courier and .pdfAlphaVision2
 
Question Content AreaCost flow is in the reverse order in which co.pdf
Question Content AreaCost flow is in the reverse order in which co.pdfQuestion Content AreaCost flow is in the reverse order in which co.pdf
Question Content AreaCost flow is in the reverse order in which co.pdfAlphaVision2
 
QUESTION TWODescribe the various ecological issues facing project.pdf
QUESTION TWODescribe the various ecological issues facing project.pdfQUESTION TWODescribe the various ecological issues facing project.pdf
QUESTION TWODescribe the various ecological issues facing project.pdfAlphaVision2
 
Recuerde la Aplicaci�n sobre la propiedad intelectual en las cuentas.pdf
Recuerde la Aplicaci�n sobre la propiedad intelectual en las cuentas.pdfRecuerde la Aplicaci�n sobre la propiedad intelectual en las cuentas.pdf
Recuerde la Aplicaci�n sobre la propiedad intelectual en las cuentas.pdfAlphaVision2
 
Question 6The IT department of a company has just rolled out a vir.pdf
Question 6The IT department of a company has just rolled out a vir.pdfQuestion 6The IT department of a company has just rolled out a vir.pdf
Question 6The IT department of a company has just rolled out a vir.pdfAlphaVision2
 
Receiving a COVID vaccine causes a persons immune system to produce.pdf
Receiving a COVID vaccine causes a persons immune system to produce.pdfReceiving a COVID vaccine causes a persons immune system to produce.pdf
Receiving a COVID vaccine causes a persons immune system to produce.pdfAlphaVision2
 
Recapitulation via hypermorphosisRecapitulation via neoteny WQ3 P.pdf
Recapitulation via hypermorphosisRecapitulation via neoteny WQ3 P.pdfRecapitulation via hypermorphosisRecapitulation via neoteny WQ3 P.pdf
Recapitulation via hypermorphosisRecapitulation via neoteny WQ3 P.pdfAlphaVision2
 
Read two op-eds on the issue of Voter ID. The first op-ed should be .pdf
Read two op-eds on the issue of Voter ID. The first op-ed should be .pdfRead two op-eds on the issue of Voter ID. The first op-ed should be .pdf
Read two op-eds on the issue of Voter ID. The first op-ed should be .pdfAlphaVision2
 
Read the Resolving Ethical Business Challenges case at the covering .pdf
Read the Resolving Ethical Business Challenges case at the covering .pdfRead the Resolving Ethical Business Challenges case at the covering .pdf
Read the Resolving Ethical Business Challenges case at the covering .pdfAlphaVision2
 
Read the book of First Corinthians, chapter 12. Among three top reas.pdf
Read the book of First Corinthians, chapter 12. Among three top reas.pdfRead the book of First Corinthians, chapter 12. Among three top reas.pdf
Read the book of First Corinthians, chapter 12. Among three top reas.pdfAlphaVision2
 
Read the attached case on GunnAllens experience with computer secur.pdf
Read the attached case on GunnAllens experience with computer secur.pdfRead the attached case on GunnAllens experience with computer secur.pdf
Read the attached case on GunnAllens experience with computer secur.pdfAlphaVision2
 
Read Case Study below �How Secure Is BYOD� and answer the questions.pdf
Read Case Study below �How Secure Is BYOD� and answer the questions.pdfRead Case Study below �How Secure Is BYOD� and answer the questions.pdf
Read Case Study below �How Secure Is BYOD� and answer the questions.pdfAlphaVision2
 
Rather than being sold on invention, VW realized that sometimes peop.pdf
Rather than being sold on invention, VW realized that sometimes peop.pdfRather than being sold on invention, VW realized that sometimes peop.pdf
Rather than being sold on invention, VW realized that sometimes peop.pdfAlphaVision2
 
Question content area top Part 1 Brett Enterprises had the following.pdf
Question content area top Part 1 Brett Enterprises had the following.pdfQuestion content area top Part 1 Brett Enterprises had the following.pdf
Question content area top Part 1 Brett Enterprises had the following.pdfAlphaVision2
 
Ravi es el director ejecutivo de una empresa de revistas. Quiere div.pdf
Ravi es el director ejecutivo de una empresa de revistas. Quiere div.pdfRavi es el director ejecutivo de una empresa de revistas. Quiere div.pdf
Ravi es el director ejecutivo de una empresa de revistas. Quiere div.pdfAlphaVision2
 
Rate of Return if state occursState of EconomyProbabilitySto.pdf
Rate of Return if state occursState of EconomyProbabilitySto.pdfRate of Return if state occursState of EconomyProbabilitySto.pdf
Rate of Return if state occursState of EconomyProbabilitySto.pdfAlphaVision2
 
Raphael y Martina est�n comprometidos y planean viajar a Las Vegas.pdf
Raphael y Martina est�n comprometidos y planean viajar a Las Vegas.pdfRaphael y Martina est�n comprometidos y planean viajar a Las Vegas.pdf
Raphael y Martina est�n comprometidos y planean viajar a Las Vegas.pdfAlphaVision2
 
Rank the given minerals in terms of their rate of weathering from fa.pdf
Rank the given minerals in terms of their rate of weathering from fa.pdfRank the given minerals in terms of their rate of weathering from fa.pdf
Rank the given minerals in terms of their rate of weathering from fa.pdfAlphaVision2
 

Más de AlphaVision2 (20)

Question content area top Part 1 Weights (kg) of poplar trees were o.pdf
Question content area top Part 1 Weights (kg) of poplar trees were o.pdfQuestion content area top Part 1 Weights (kg) of poplar trees were o.pdf
Question content area top Part 1 Weights (kg) of poplar trees were o.pdf
 
QUESTION 7 Buffleheads are small diving ducks that primarily eat aqu.pdf
QUESTION 7 Buffleheads are small diving ducks that primarily eat aqu.pdfQUESTION 7 Buffleheads are small diving ducks that primarily eat aqu.pdf
QUESTION 7 Buffleheads are small diving ducks that primarily eat aqu.pdf
 
Question-1 (courier Services) As an employee of a large courier and .pdf
Question-1 (courier Services) As an employee of a large courier and .pdfQuestion-1 (courier Services) As an employee of a large courier and .pdf
Question-1 (courier Services) As an employee of a large courier and .pdf
 
Question Content AreaCost flow is in the reverse order in which co.pdf
Question Content AreaCost flow is in the reverse order in which co.pdfQuestion Content AreaCost flow is in the reverse order in which co.pdf
Question Content AreaCost flow is in the reverse order in which co.pdf
 
QUESTION TWODescribe the various ecological issues facing project.pdf
QUESTION TWODescribe the various ecological issues facing project.pdfQUESTION TWODescribe the various ecological issues facing project.pdf
QUESTION TWODescribe the various ecological issues facing project.pdf
 
Recuerde la Aplicaci�n sobre la propiedad intelectual en las cuentas.pdf
Recuerde la Aplicaci�n sobre la propiedad intelectual en las cuentas.pdfRecuerde la Aplicaci�n sobre la propiedad intelectual en las cuentas.pdf
Recuerde la Aplicaci�n sobre la propiedad intelectual en las cuentas.pdf
 
Question 6The IT department of a company has just rolled out a vir.pdf
Question 6The IT department of a company has just rolled out a vir.pdfQuestion 6The IT department of a company has just rolled out a vir.pdf
Question 6The IT department of a company has just rolled out a vir.pdf
 
Receiving a COVID vaccine causes a persons immune system to produce.pdf
Receiving a COVID vaccine causes a persons immune system to produce.pdfReceiving a COVID vaccine causes a persons immune system to produce.pdf
Receiving a COVID vaccine causes a persons immune system to produce.pdf
 
Recapitulation via hypermorphosisRecapitulation via neoteny WQ3 P.pdf
Recapitulation via hypermorphosisRecapitulation via neoteny WQ3 P.pdfRecapitulation via hypermorphosisRecapitulation via neoteny WQ3 P.pdf
Recapitulation via hypermorphosisRecapitulation via neoteny WQ3 P.pdf
 
Read two op-eds on the issue of Voter ID. The first op-ed should be .pdf
Read two op-eds on the issue of Voter ID. The first op-ed should be .pdfRead two op-eds on the issue of Voter ID. The first op-ed should be .pdf
Read two op-eds on the issue of Voter ID. The first op-ed should be .pdf
 
Read the Resolving Ethical Business Challenges case at the covering .pdf
Read the Resolving Ethical Business Challenges case at the covering .pdfRead the Resolving Ethical Business Challenges case at the covering .pdf
Read the Resolving Ethical Business Challenges case at the covering .pdf
 
Read the book of First Corinthians, chapter 12. Among three top reas.pdf
Read the book of First Corinthians, chapter 12. Among three top reas.pdfRead the book of First Corinthians, chapter 12. Among three top reas.pdf
Read the book of First Corinthians, chapter 12. Among three top reas.pdf
 
Read the attached case on GunnAllens experience with computer secur.pdf
Read the attached case on GunnAllens experience with computer secur.pdfRead the attached case on GunnAllens experience with computer secur.pdf
Read the attached case on GunnAllens experience with computer secur.pdf
 
Read Case Study below �How Secure Is BYOD� and answer the questions.pdf
Read Case Study below �How Secure Is BYOD� and answer the questions.pdfRead Case Study below �How Secure Is BYOD� and answer the questions.pdf
Read Case Study below �How Secure Is BYOD� and answer the questions.pdf
 
Rather than being sold on invention, VW realized that sometimes peop.pdf
Rather than being sold on invention, VW realized that sometimes peop.pdfRather than being sold on invention, VW realized that sometimes peop.pdf
Rather than being sold on invention, VW realized that sometimes peop.pdf
 
Question content area top Part 1 Brett Enterprises had the following.pdf
Question content area top Part 1 Brett Enterprises had the following.pdfQuestion content area top Part 1 Brett Enterprises had the following.pdf
Question content area top Part 1 Brett Enterprises had the following.pdf
 
Ravi es el director ejecutivo de una empresa de revistas. Quiere div.pdf
Ravi es el director ejecutivo de una empresa de revistas. Quiere div.pdfRavi es el director ejecutivo de una empresa de revistas. Quiere div.pdf
Ravi es el director ejecutivo de una empresa de revistas. Quiere div.pdf
 
Rate of Return if state occursState of EconomyProbabilitySto.pdf
Rate of Return if state occursState of EconomyProbabilitySto.pdfRate of Return if state occursState of EconomyProbabilitySto.pdf
Rate of Return if state occursState of EconomyProbabilitySto.pdf
 
Raphael y Martina est�n comprometidos y planean viajar a Las Vegas.pdf
Raphael y Martina est�n comprometidos y planean viajar a Las Vegas.pdfRaphael y Martina est�n comprometidos y planean viajar a Las Vegas.pdf
Raphael y Martina est�n comprometidos y planean viajar a Las Vegas.pdf
 
Rank the given minerals in terms of their rate of weathering from fa.pdf
Rank the given minerals in terms of their rate of weathering from fa.pdfRank the given minerals in terms of their rate of weathering from fa.pdf
Rank the given minerals in terms of their rate of weathering from fa.pdf
 

Último

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 

Último (20)

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 

Question #13 Consider a simple class for wrapping a file descriptor..pdf

  • 1. Question #13 Consider a simple class for wrapping a file descriptor. What are the minimal change(s) that would be required to make the class: 1. hard to accidentally misuse (e.g. causing an invalid or undesired file descriptor to be closed), and 2. usable as a return value from a function? 1. Adding a custom move constructor and move assignment operator. Filedescriptor(filenescriptorss chs) noexcept : fd_(rhs.fd_) f rhs.fd_ =1; i Filedescriptors operator-(FiloDescriptorss chs) noexcept f using std: :swap; swap(fd, rhs. Fd_); return wthis; 2. Adding a custom copy constructor and copy assignment operator: Filedescriptor(Filedescrintor consts rhs) : fd_(rhs.fo_) [) Filedescriptors operator- (FileDoscriptor consts rhs) t fd_- rhs.fd-; feturn *this; J 3. Disabling the copy constructor and copy assignment operator: F11eDescriptor(FileDescriptor consts) - delete; Filedescriptars operator-(Filedescriptor consts) - delete; 4. Disabling the move constructor and move assignment operator: F11cDescriptor(FiloDescriptorss)=de1ete;F11eDescriptorsoperator-(F11edescriptors8)=delete; 5. Adding default implementations of the move constructor and move assignment operator: Filedescriptor(Filedescrtptarss) - defau1t; FlieDescriptors operator-(FileDescriptonss) - default;