microsoft / cpprestsdk

The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services.
Other
7.96k stars 1.65k forks source link

Why is this library so verbose...? #1678

Closed ughstudios closed 2 years ago

ughstudios commented 2 years ago
const std::string GetRegistrationURL() {
    return std::string(BASE_URL) + std::string("/register");
}

auto uri_str = utility::conversions::to_string_t(utility::conversions::utf8_to_utf16(GetRegistrationURL()));
uri registration_uri(uri_str);

Why is this the only way to actually use std::string in this api??

barcharcraz commented 2 years ago

most of it is just (possible overuse of) namespaces. Some using namespace or using directives can reduce verbosity considerably.