Code Monkey home page Code Monkey logo

Comments (4)

jcoder58 avatar jcoder58 commented on August 17, 2024 1

I've made the changes you suggest and everything compiles.

I used return m_value != 0;

I'm compile it as part of Unreal Engine, so I assume it uses /W4.

from ureact.

YarikTH avatar YarikTH commented on August 17, 2024

C4800 Implicit conversion from 'const size_t' to bool. Possible information loss
ureact\detail\take_drop_base.hpp 52

    // checkable in boolean context
    explicit operator bool() const
    {
        return m_value;
    }

It is valid C++ code. Try to change it with either of the following variants:

return bool(m_value);
return static_cast<bool>(m_value);
return m_value != 0;
return !!m_value;

I need to know which of them don't trigger the error.

from ureact.

YarikTH avatar YarikTH commented on August 17, 2024

C4459 declaration of 'elements' hides global declaration

ureact\detail\slot_map.hpp 261

        void shake( const size_type elements )
        {
            const auto total_size = [&]() { return elements + m_size; };

            while( m_size > 0 && back_() == total_size() - 1 )
            {
                --m_size;
            }
        }

It seems that is is consequence of using namespace ureact and including <ureact/adaptor/elements.hpp>. Normally they are in different namespaces, so there is no any trace of shadowing. But once elements included in the global scope, it's become a reason for warning.

Try to rename elements arg to elements_amount or something. It was not so correct name in the first place.

from ureact.

YarikTH avatar YarikTH commented on August 17, 2024

I need to check my MSVC warnings list. Ureact is tested with github actions with lots of enabled warnings. Which warnings flags do you use? I use /W3. I heard that /W4 is kinda broken. It is full of false positives like you listed above. That's why /W3 is IDE default level, at least it is useful.

from ureact.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.