#cpr cannot call constructor
1 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
'cpr::Session &cpr::Session::operator =(cpr::Session &&) noexcept': attempting to reference a deleted function
session = cpr::Session();
class LCU
{
public:
static inline cpr::Session session;
}
this is how the class looks like
move assignment operator has been explicitely declared as deleted
uh?
class Session : public std::enable_shared_from_this<Session> {
public:
Session();
Session(const Session& other) = delete;
Session(Session&& old) = delete;
~Session() = default;
Session& operator=(Session&& old) noexcept = delete;
Session& operator=(const Session& other) = delete;```
thats their code
so basically
you are talking about the second last line, no?
you declared session as a cpr::Session object and its default constructor gets called automatically, and then later you try to assign another value to session with the line session = cpr::Session();, which uses the = operator
and that got "disabled" by setting it to delete?
Yep
meaning i cannot reinstanciate the object hence its being instanciated if the constructor gets called which happens on the static inline cpr::Session session?
yeah, I'm wondering, where do you define the static variable?
you only showed the declaration
well it was about to happen here
bool LCU::InitClientInfo(const ClientInfo& info)
{
session = cpr::Session();
session.SetVerifySsl(false);
session.SetHeader(Utils::StringToHeader(league.header));
return true;
}
but isn't there any cpr::Session LCU::session = ... in your code?
oh nvm
it's inline already
nop
then, it's already default constructed
so there i no need to assign it, because i cant
yeah you can't and it already has been initialized anyway
@solemn prism Has your question been resolved? If so, type !solved :)
!solved