Giter Site home page Giter Site logo

隐式类型转换问题 about udrefl HOT 2 CLOSED

ubpa avatar ubpa commented on August 11, 2024
隐式类型转换问题

from udrefl.

Comments (2)

Ubpa avatar Ubpa commented on August 11, 2024

UDRefl_test_21_string 测试用例里的是个 bug,目前已修复
UDRefl 隐式转换的条件可查看 ReflMngr::IsCompatible,总结就是,当满足引用条件、指针/数组条件或可构造条件时发生类型转换。另外当形参类型为 ObjectView 时,可接受一切类型的实参。
"hello world" 类型是 &{const{[12]{int8}}},而我在 ReflMngr 的构造函数中,默认注册了 std::string 及其构造函数 std::string(const char*),所以 MakeShared 时可以发生数组到指针的转换。
发生隐式类型转换时,目前没有警告。暂时也不会引入警告机制。因为“我们认为这是合理的”,一切都跟使用静态 C++ 一样自然即可。
另外,一切函数调用都可能会失败,失败可通过返回值中的 Type 是否有效来判断。(返回值为 void 时,Type 也是有效的)

f6e12ec

from udrefl.

uikino avatar uikino commented on August 11, 2024

谢谢。受教了,等下我再提个静态库的新issue。

from udrefl.

Related Issues (12)

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.