Home
Blogs
Questions
Jobs
Monetize

Home

About Us

Blogs

Questions

Jobs

Monetize

Post Job

banner

Questions about ref-qualifier

Read more about ref-qualifier

python (65.2k questions)

javascript (44.3k questions)

reactjs (22.7k questions)

java (20.8k questions)

c# (17.4k questions)

html (16.3k questions)

r (13.7k questions)

android (13k questions)

Questions - ref-qualifier

C++ user-defined conversions, ref-qualifiers and overload resolution

Please, help me understand what's wrong with this piece of code: #include <string> #include <utility> class Sample { public: explicit Sample(std::string data): _data(std::move...
test-img

Yurii A

c++

c++11

implicit-conversion

overload-resolution

ref-qualifier

Votes: 0

Answers: 0

Is there a use-case for std::string&#39;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...
test-img

user589321

c++

stdstring

rvalue

temporary

ref-qualifier

Votes: 0

Answers: 2

Latest Answer

Before shrink_to_fit was available, a common idiom to make sure a string's memory was free'd was to swap your string with a temporary one: std::string().swap(some_string); I guess someone could have ...
test-img

Fatih BAKIR

Posts

Questions

Blogs

Jobs

The ultimate platform for coders and IT specialists

About

  • Company
  • Support

  • Platform

  • Terms & Conditions
  • Privacy statement
  • Cookie policy
  • Cookie option
  • OnlyCoders © 2025  |  All rights reserved