Questions tagged [xvalue]

"xvalue" is a C++11 term for an expiring value that can be moved from

From the proposed C++11 standard:

An xvalue (an “eXpiring” 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. — end example ]

60 questions
0
votes
1 answer

How can I change dates on an X axis into 'day 1', 'day 2' etc for a line graph plot?

I am trying to modify a line graph i have already made. On the x axis, it has the data in which a participant completed a task. However, I am trying to make it so the x axis simply show each completed session of the task as day 1, day 2 etc.... Is…
JacobHad
  • 33
  • 4
0
votes
1 answer

Why does referencing an xvalue not extend the lifetime of the object it refers to?

The compiler has no way of knowing whether the xvalue is actually referencing a temporary. Therefore if the xvalue is a reference to some specific persistent "non-temporary" object, we would not want tie the lifetime of this object to the new…
Jake1234
  • 187
  • 1
  • 7
0
votes
0 answers

Excel VBA Chart XValues Aren't Aligned Properly

I've got a large set of data that I'm trying to go through to dynamically make a chart out of. Each column value is aligned with a specific time value. There is a column called "Type" that hold either an empty cell, "Log ", "Log+", "SRst", "ARst",…
jakewags01
  • 41
  • 4
0
votes
0 answers

After merging two files, one x value gets repeated twice in the plot

I have two datasets that I merge into one, and then I make a plot. At this last stage, I get an x value repeated twice ('2 hours'), second point (correct) and also as last x value (wrong). If I plot the individual datasets this problem does not…
0
votes
0 answers

Examples of rvalue, lvalues, xvalues, glvalues, and prvalues?

This post What are rvalues, lvalues, xvalues, glvalues, and prvalues? provides the definitions of rvalue, lvalues, xvalues, glvalues, and prvalues, but I don't see examples. I think I have a solid understanding of lvalues and rvalues, but not so…
24n8
  • 1,898
  • 1
  • 12
  • 25
0
votes
1 answer

What steps should I take to determine the value category of an expression?

I'm rather confused about determiming the value category of an expression. Could you please provide the basic steps that should be taken (what should be analysed) to determing the value category of an expression?
beginpluses
  • 497
  • 2
  • 9
0
votes
1 answer

Why a function call is an xvalue (if return type is an rvalue)?

Let's say we have a function: struct A { int m; }; A&& f(); As far as I know the expressions: f(); f().m; are both xvalue. But why? Why aren't they prvalue? I'm a little bit confused.
embedc
  • 1,485
  • 1
  • 6
  • 20
0
votes
0 answers

push_back a PRvalue into a vector

Carefully reading the references, A move constructor can only be called by a Xvalue. Then, how something like... std::vector vec vec.push_back(Class(..args..)) is possible without moving(casting) it to an Xvalue? Is there a specific way to…
Ray Kim
  • 33
  • 2
  • 8
0
votes
0 answers

C++ using xvalue (rvalue reference) as lvalue

In the following code, I have a big vector with 10 members that can be divided into 4 subvectors: data[10] P=data[0 to 2] Q=data[3 to 5] R=data[6 to 6] S=data[7 to 9] Since, vector R only has one member, I prefer to return an rvalue directly from…
ar2015
  • 5,558
  • 8
  • 53
  • 110
0
votes
1 answer

find where the maximum deviation of an interpolated function occurs?

I need to compare the maximum deviation of the interpolated function to the true value of the functionf(x)=exp(x). I don't know how to find the x-value where this occurs as i used x=np.linspace() to plot the interpolation and the true function. My…
0
votes
1 answer

Does xvalue/prvalue category really matter?

The only way to create xvalue is use static_cast< T&& > conversion. Yes, according to standard there are also three other situation but all of them require another xvalue. So, for simplicity, I will assume that is only way for now. We need pass…
Alprog
  • 103
  • 2
  • 10
0
votes
1 answer

Finding Y value from X value in MSChart Series

I have created a Line chart using MSChart 2008.I have Dates on the x axis and Double values on y axis.Now I need to find Y value on Todays Date(Which will be my x value)..Can anybody help me to achieve this. Thanks
user2047818
  • 15
  • 1
  • 8
-1
votes
1 answer

Is temporary object initialization expresssion implicitly converted to xvalue while we access the this pointer?

The code is: class A { public: void f() { cout << this; } }; int main() { A{}; // prvalue A{}.f(); // Is A{} in here converted to xvalue? } On https://en.cppreference.com/w/cpp/language/implicit_conversion, I learned the Temporary…
colin
  • 49
  • 2
-1
votes
1 answer

from a series of datetimes, how to downsample and select less number of dates and put them in the x labels and xticks?

i am making a plot on which the x axis represents dates and the y axis represents total covid cases. the problem is that due to a large dataset, there are many dates on the x axis and when i am ploting that i am getting a plot on which the xtick…
Somu Nath
  • 33
  • 5
-1
votes
1 answer

modern c++, understanding of xvalue

Modern C++ only adds one new type "xvalue"? The right reference returned by a function is xvalue, this is defined, just like the right reference in the parameters of a function, which can only bind to right value? These understandings correct? The…
John
  • 1
  • 2
1 2 3
4