alizer lists ](/w/cpp/language/constructor
"cpp/language/constructor")  
[ Default member initializer
](/w/cpp/language/data_members#Member_initialization "cpp/language/data
members") (C++11)  
[ ` friend ` specifier ](/w/cpp/language/friend "cpp/language/friend")  
[ ` explicit ` specifier ](/w/cpp/language/explicit "cpp/language/explicit")  
[ Converting constructor ](/w/cpp/language/converting_constructor
"cpp/language/converting constructor")  
Special member functions  
[ Default constructor ](/w/cpp/language/default_constructor
"cpp/language/default constructor")  
[ Copy constructor ](/w/cpp/language/copy_constructor "cpp/language/copy
constructor")  
[ Move constructor ](/w/cpp/language/move_constructor "cpp/language/move
constructor") (C++11)  
[ Copy assignment operator ](/w/cpp/language/copy_assignment
"cpp/language/copy assignment")  
[ Move assignment operator ](/w/cpp/language/move_assignment
"cpp/language/move assignment") (C++11)  
[ Destructor ](/w/cpp/language/destructor "cpp/language/destructor")  
Inheritance  
[ Base and derived classes ](/w/cpp/language/derived_class
"cpp/language/derived class")  
[ Empty base optimization (EBO) ](/w/cpp/language/ebo "cpp/language/ebo")  
[ Virtual member functions ](/w/cpp/language/virtual "cpp/language/virtual")  
[ Pure virtual functions and abstract classes ](/w/cpp/language/abstract_class
"cpp/language/abstract class")  
[ ` override ` specifier ](/w/cpp/language/override "cpp/language/override")
(C++11)  
[ ` final ` specifier ](/w/cpp/language/final "cpp/language/final") (C++11)  
  
[ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/language/classes/navbar_content&action=edit)

##  Contents

  * 1  Syntax 
  * 2  Explanation 
  * 3  Keywords 
  * 4  Example 
  * 5  Defect reports 

  
---  
  
###  [ [ edit ](/mwiki/index.php?title=cpp/language/this&action=edit&section=1
"Edit section: Syntax") ]  Syntax  
  
---  
` **this** ` |  |   
  
The expression  this  is a [ prvalue ](/w/cpp/language/value_category#prvalue
"cpp/language/value category") [ expression ](/w/cpp/language/expressions
"cpp/language/expressions") whose value is the address of the [ implicit
object parameter
](/w/cpp/language/overload_resolution#Implicit_object_parameter
"cpp/language/overload resolution") (object on which the  non-static member
function  (until C++23)  implicit object member function  (since C++23)  is
being called). It can appear in the following contexts:

1)  Within the body of any  [ non-static member function
](/w/cpp/language/member_functions "cpp/language/member functions") (until
C++23)  [ implicit object member function ](/w/cpp/language/member_functions
"cpp/language/member functions") (since C++23)  , including [ member
initializer list ](/w/cpp/language/initializer_list "cpp/language/initializer
list") , and [ lambda expression body
](/w/cpp/language/lambda#closure_type_fun_operator "cpp/language/lambda")
(since C++11)  .

2)  Within the [ declaration ](/w/cpp/language/function
"cpp/language/function") of a  non-static member function  (until C++23)
implicit object member function  (since C++23)  anywhere after the (optional)
cv-qualifier sequence, including

  * [ dynamic exception specification ](/w/cpp/language/except_spec "cpp/language/except spec") , 

|  (until C++17)  
---|---  
  
  * [ noexcept specification ](/w/cpp/language/noexcept_spec "cpp/language/noexcept spec") , and 
  * the trailing return type. 

|  (since C++11)  
---|---  
  
3)  Within [ default member initializer ](/w/cpp/language/data_members#Member_initialization "cpp/language/data members") .  4)  Within [ lambda-expression capture ](/w/cpp/language/lambda#Lambda_capture "cpp/language/lambda") list.  |  (since C++11)   
---|---  
  
###  [ [ edit ](/mwiki/index.php?title=cpp/language/this&action=edit&section=2
"Edit section: Explanation") ]  Explanation

this  can only associate with the innermost enclosing class of its appearance,
even if the appearance is invalid i