python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
Getter returns a rvalue?
I know it's a bad attempt but why we cannot edit the private member via the getter?
class A
{
int a = 2;
public:
int GetA1() { return a; }
int& GetA2() { return a; }
int* GetA3() {...
ripfreeworld
Votes: 0
Answers: 3
clang++: candidate function [with Callable_T = void (int, double), Args_T = <int, double>] not viable: expects an rvalue for 3rd argument
I have a test framework where I need to capture the call to a generic function (a test suite) and execute it at a later time.
For this I use a class template with a parameter pack and I store the argu...
ilg
Votes: 0
Answers: 1
Is a prvalue the same as a temporary in C++17
I am trying to know whether a prvalue is same as a temporary in C++17. Consider the following example,
//C++17 example
#include <iostream>
struct Custom
{
Custom()
{
std::cout&l...
Jason
Votes: 0
Answers: 1
Is there a use-case for std::string's operator= to not be lvalue ref-qualified?
The post here points out that std::string's member operator= is not lvalue ref-qualified. That allows us to write code such as this:
std::string() = "Hello";
The linked post asks why this i...
user589321
Votes: 0
Answers: 2