{"id":2444,"date":"2016-01-01T20:52:29","date_gmt":"2016-01-01T19:52:29","guid":{"rendered":"http:\/\/roboblog.fatal-fury.de\/?p=2444"},"modified":"2016-01-01T20:52:29","modified_gmt":"2016-01-01T19:52:29","slug":"rvalues-lvalues-xvalues-glvalues-prvalues-wtf","status":"publish","type":"post","link":"http:\/\/roboblog.fatal-fury.de\/?p=2444","title":{"rendered":"rvalues, lvalues, xvalues, glvalues, prvalues WTF??"},"content":{"rendered":"<p>Sehr zu empfehlen:<br \/>\n<a href=\"http:\/\/www.stroustrup.com\/terminology.pdf\">http:\/\/www.stroustrup.com\/terminology.pdf<\/a><\/p>\n<pre><code>\r\nint   prvalue();\r\nint&  lvalue();\r\nint&& xvalue();\r\n\r\nvoid foo(int&& t) {\r\n  \/\/ t is initialized with an rvalue expression\r\n  \/\/ but is actually an lvalue expression itself\r\n}\r\n<\/code><\/pre>\n<p><a href=\"http:\/\/roboblog.fatal-fury.de\/wp-content\/uploads\/2016\/01\/GNhBF.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/roboblog.fatal-fury.de\/wp-content\/uploads\/2016\/01\/GNhBF.png\" alt=\"GNhBF\" width=\"361\" height=\"251\" class=\"alignnone size-full wp-image-2445\" srcset=\"http:\/\/roboblog.fatal-fury.de\/wp-content\/uploads\/2016\/01\/GNhBF.png 361w, http:\/\/roboblog.fatal-fury.de\/wp-content\/uploads\/2016\/01\/GNhBF-300x209.png 300w\" sizes=\"auto, (max-width: 361px) 100vw, 361px\" \/><\/a><\/p>\n<blockquote><p>\n    \u2014 An lvalue (so called, historically, because lvalues could appear on the left-hand side of an assignment expression) designates a function or an object. [ Example: If E is an expression of pointer type, then *E is an lvalue expression referring to the object or function to which E points. As another example, the result of calling a function whose return type is an lvalue reference is an lvalue. \u2014end example ]<\/p>\n<p>    \u2014 An xvalue (an \u201ceXpiring\u201d value) also refers to an object, usually near the end of its lifetime (so that its resources may be moved, for example). An xvalue is the result of certain kinds of expressions involving rvalue references (8.3.2). [ Example: The result of calling a function whose return type is an rvalue reference is an xvalue. \u2014end example ]<\/p>\n<p>    \u2014 A glvalue (\u201cgeneralized\u201d lvalue) is an lvalue or an xvalue.<\/p>\n<p>    \u2014 An rvalue (so called, historically, because rvalues could appear on the right-hand side of an assignment expressions) is an xvalue, a temporary object (12.2) or subobject thereof, or a value that is not associated with an object.<\/p>\n<p>    \u2014 A prvalue (\u201cpure\u201d rvalue) is an rvalue that is not an xvalue. [ Example: The result of calling a function whose return type is not a reference is a prvalue. The value of a literal such as 12, 7.3e5, or true is also a prvalue. \u2014end example ]<\/p>\n<p>    Every expression belongs to exactly one of the fundamental classifications in this taxonomy: lvalue, xvalue, or prvalue. This property of an expression is called its value category. [ Note: The discussion of each built-in operator in Clause 5 indicates the category of the value it yields and the value categories of the operands it expects. For example, the built-in assignment operators expect that the left operand is an lvalue and that the right operand is a prvalue and yield an lvalue as the result. User-defined operators are functions, and the categories of values they expect and yield are determined by their parameter and return types. \u2014end note\n<\/p><\/blockquote>\n<p>http:\/\/www.open-std.org\/jtc1\/sc22\/wg21\/docs\/papers\/2010\/n3055.pdf<br \/>\nhttp:\/\/stackoverflow.com\/questions\/3601602\/what-are-rvalues-lvalues-xvalues-glvalues-and-prvalues<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sehr zu empfehlen: http:\/\/www.stroustrup.com\/terminology.pdf int prvalue(); int&#038; lvalue(); int&#038;& xvalue(); void foo(int&#038;& t) { \/\/ t is initialized with an rvalue expression \/\/ but is actually an lvalue expression itself } \u2014 An lvalue (so called, historically, because lvalues could appear on the left-hand side of an assignment expression) designates a function or an object. [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[17],"class_list":["post-2444","post","type-post","status-publish","format-standard","hentry","category-allgemein","tag-cpp"],"_links":{"self":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts\/2444","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2444"}],"version-history":[{"count":2,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts\/2444\/revisions"}],"predecessor-version":[{"id":2447,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=\/wp\/v2\/posts\/2444\/revisions\/2447"}],"wp:attachment":[{"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2444"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2444"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/roboblog.fatal-fury.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2444"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}