In C ++, is “class instance" the only type of object?

Help me figure this out. If I consider all C ++ standards, including C ++ 11, is it right to say that the only object I can handle is an instance of the class?

what about other players like lambda? POD instance is considered an object?

I know this sounds like a small detail, but most of the time I found that concepts from other languages ​​are difficult to compare when I have problems that determine what an object is and what is not, especially in the functional OOP languages.

+5
source share
3 answers

++, ++ 11, , , , ?

, .

++ "" , ( ), .

1.8/1 ++ 11:

++ , , , . - . [. , , , . -end note] (3.1), (5.3.4) (12.2), . , . ( 3). (3.7), (3.8). (3.9). , . (10.3); , , . , (. 5) .

, int , POD , , , . "" , ++ .

, lambdas?

Lambdas - ( 5.1.2/1):

- . [...]

( 5.1.2/2):

- (12.2). . [...] [: (20.8). -end note]

, lambdas - , ( , , lambdas , , , ).

+8

++ -

. a int

, ( , , )

+2

"" " ", .

++ - - " , ". , "" ++ " " "" , .

++, , , () - () - ( | ), .

++ , .

, ++ , , "" ( , ), - ++.

lambdas, , ( ), .

, , : a+b : ( ). [](){}: : , ,

auto fn = [](){}; //create a lambda and assign to fn.
fn();             //just calls it

fn

class lambda_uniquename
{
public:
   void operator()()
   {}
};

lambda, fn.

+2

All Articles