Skip to content

const std::string return value results in pessimization #160

@kauboy26

Description

@kauboy26

Hi,

I was taking a look at path.hpp and found that some functions, such as path::string(), returned by value but were marked as const.

So for example, if I had a path object path1, and then I made a std::string object s as follows:

std::string s = path1.string();  

The above would call std::string's copy constructor rather than its move constructor.

I was wondering if this was intended behavior, as we are missing a chance to optimize.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions