WhiZTiM / UbjsonCpp

A high performance C++14 library for effortlessly reading and writing UBJSON
24 stars 11 forks source link

rvalue reference qualified conversion operator induces a potential bug #3

Closed WhiZTiM closed 8 years ago

WhiZTiM commented 8 years ago

Given this code

using namespace ubjson;
    Value m;
    m = "Hello UBJSON"
    static_cast<std::string>(std::move(m))
    //or
    //static_cast<std::string&&)(m)

    ASSERT(m.type() == Type::String); //this assertion fires

Given, that no object recieved the rvalue conversion, this object is still a string

WhiZTiM commented 8 years ago

Fixed in this commit https://github.com/WhiZTiM/UbjsonCpp/commit/7b346262014ed8208849b23b78042e9358975dae