Skip to content
Sign UpLog In
Profile icon

VofaDev

@VofaDev
(Now an alt account for @wsDev)
  • Copper

    Cover page
    Made with Bash
    Recent comments (6)
    mollthecoder
    mollthecoder
    2 years ago

    Is this working yet?

    xxpertHacker
    xxpertHacker
    2 years ago

    Hey, just a small tip: a few of the standard library's string-related types and numerical types have user-defined-literal operators for creating them.

    std::string is among those types, there is a std::operator""s provided for constructing them from string literals.

    std::string foo = std::string("foo"); std::string bar = std::string("bar"); // vs using std::operator""s; // unnecessary in your case, since you already included the entire {namespace std} std::string foo = "foo"s; std::string bar = "bar"s;

    seeing as you passed string literals to the std::string constructor a few times, I thought that you might be interested in cutting down the code.

    XanthusPettitt
    XanthusPettitt
    2 years ago

    huh this is cool I would like to try to make a calc out of this when its done

Repls
Community
All Repls