Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) C++11 explicit function default

 

An explicit function default is a C++11 feature for explicitly writing that a certain function is default generated by the compiler.

 

 

 

 

 

 

Technical facts

 

Application type(s)

Operating system(s) or programming environment(s)

IDE(s):

Project type:

C++ standard:

Compiler(s):

Libraries used:

 

 

 

 

 

Qt project file: CppExplicitFunctionDefaults.pro

 

#-------------------------------------------------
#
# Project created by QtCreator 2011-08-05T07:41:07
#
#-------------------------------------------------
QT       += core
QT       -= gui
QMAKE_CXXFLAGS += -std=c++0x
TARGET = CppExplicitFunctionDefaults
CONFIG   += console
CONFIG   -= app_bundle
TEMPLATE = app
SOURCES += main.cpp

 

 

 

 

 

main.cpp

 

///The POD has explicit function defaults
struct POD
{
  POD() = default;
  ~POD() = default;
  POD& operator=(const POD&) = default;
  POD(const POD&) = default;
};

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict