Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::IMoveOnly Class Reference

Marks the derived class as move only. More...

#include <IMoveOnly.h>

Inheritance diagram for ph::IMoveOnly:
ph::TSdlBruteForceFieldSet< ph::TSdlOwnedField< MethodStruct > > ph::TSdlBruteForceFieldSet< TSdlOwnedField< Owner > > ph::TSdlBruteForceFieldSet< ph::TSdlOwnedField< StructType > > ph::CoreCookedUnit ph::Film ph::FrameProcessingPipeline ph::FrameProcessor ph::InitiallyPausedThread ph::MemoryArena ph::ReceiverSamplingWork ph::TSdlBruteForceFieldSet< BaseFieldType, MAX_FIELDS > ph::TUniquePtrVector< BaseType > ph::VisualWorld ph::mipmapgen

Protected Member Functions

 IMoveOnly ()=default
 
 ~IMoveOnly ()=default
 
 IMoveOnly (IMoveOnly &&other)=default
 
IMoveOnlyoperator= (IMoveOnly &&rhs)=default
 
 IMoveOnly (const IMoveOnly &other)=delete
 
IMoveOnlyoperator= (const IMoveOnly &rhs)=delete
 

Detailed Description

Marks the derived class as move only.

Deriving from this class helps to prevent accidentally copying the instance. This class should never be used as a base type that points to derived class instances.

Note that one might think a "noncopyable" type like boost::noncopyable will also do the job; however, when an implementation only defines deleted copy ctor and deleted copy assignment operator, it also prevents move operations. This can be unexpected. We made this type for marking classes as move-only by explicitly define move operations as default and define copy operations as delete.

Reference: https://stackoverflow.com/questions/35743586/noncopyable-and-nonmovable-together

Constructor & Destructor Documentation

◆ IMoveOnly() [1/3]

ph::IMoveOnly::IMoveOnly ( )
inlineprotecteddefault

◆ ~IMoveOnly()

ph::IMoveOnly::~IMoveOnly ( )
inlineprotecteddefault

◆ IMoveOnly() [2/3]

ph::IMoveOnly::IMoveOnly ( IMoveOnly && other)
inlineprotecteddefault

◆ IMoveOnly() [3/3]

ph::IMoveOnly::IMoveOnly ( const IMoveOnly & other)
protecteddelete

Member Function Documentation

◆ operator=() [1/2]

IMoveOnly & ph::IMoveOnly::operator= ( const IMoveOnly & rhs)
protecteddelete

◆ operator=() [2/2]

IMoveOnly & ph::IMoveOnly::operator= ( IMoveOnly && rhs)
inlineprotecteddefault

The documentation for this class was generated from the following file: