Giter VIP home page Giter VIP logo

Comments (5)

SchaichAlonso avatar SchaichAlonso commented on May 26, 2024 1

Are you able to compile it with libc++ because I don't support it, the reason is that I wasn't able to compile a simple hello world programs with c++2a two years ago.

I don't have any plans to add libc++ support in the near future, it will cost much more effort to add it correctly.

The problem is as you wrote, I agree with that.

Much better would be something like this:

namespace std
{
#if defined(_LIBCPP_VERSION) && defined(_LIBCPP_TEMPLATE_VIS)
    template<typename ...Types>
    class _LIBCPP_TEMPLATE_VIS variant; // NOLINT(bugprone-forwarding-reference-overload)
#else
    template<typename ...Types>
    class variant; // NOLINT(bugprone-forwarding-reference-overload)
#endif
} // namespace std

Can you try it if it compiles correctly? Thx

It fails to compile, reproducing the same error the OP has.

from tinyorm.

silverqx avatar silverqx commented on May 26, 2024

Hi, macOS isn't supported as I don't have any macOS so I can't test it.

What compiler and which version do you use? I assume it's the Apple Clang. Which c++ library this compiler uses, it's libstdc++ or libc++? I'm asking because I know nothing about macOS c++ dev. env.

from tinyorm.

SchaichAlonso avatar SchaichAlonso commented on May 26, 2024

Hi,

I can reproduce this on FreeBSD, using clang++ and libc++

It's caused by the _LIBCPP_TEMPLATE_VIS macro used by std::variant as defined in <variant> to become

class __attribute__((__type_visibility__("default"))) variant;

while std::variant as defined in orm/ormconcepts.hpp:20 instead becomes

class __attribute__((__visibility__("hidden"))) variant;

where the hidden originates in the CXX_VISIBILITY_PRESET used by TinyORM.

Including <variant> instead of prototyping std::variant fixes this build failure.

from tinyorm.

silverqx avatar silverqx commented on May 26, 2024

Are you able to compile it with libc++ because I don't support it, the reason is that I wasn't able to compile a simple hello world programs with c++2a two years ago.

I don't have any plans to add libc++ support in the near future, it will cost much more effort to add it correctly.

The problem is as you wrote, I agree with that.

Much better would be something like this:

namespace std
{
#if defined(_LIBCPP_VERSION) && defined(_LIBCPP_TEMPLATE_VIS)
    template<typename ...Types>
    class _LIBCPP_TEMPLATE_VIS variant; // NOLINT(bugprone-forwarding-reference-overload)
#else
    template<typename ...Types>
    class variant; // NOLINT(bugprone-forwarding-reference-overload)
#endif
} // namespace std

Can you try it if it compiles correctly? Thx

from tinyorm.

silverqx avatar silverqx commented on May 26, 2024

I should merge it much sooner, that forward declaration was not a good idea anyway. Is merged to develop now.

from tinyorm.

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.