Giter Site home page Giter Site logo

Comments (3)

jamboree avatar jamboree commented on May 28, 2024

I committed a patch to workaround the problem, I don't have the toolchain to test, please check if it works.

from bustache.

mincequi avatar mincequi commented on May 28, 2024

Nice, one more thing:

in model.hpp you seem to forward declare std::variant. This causes the following issue:

In file included from /Users/minski/bustache/include/bustache/render.hpp:10:
/Users/minski/bustache/include/bustache/model.hpp:694:33: error: reference to 'variant' is ambiguous
    struct impl_compatible<std::variant<T...>>
                                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/variant:1261:28: note: candidate found by name lookup is 'std::__1::variant'
class _LIBCPP_TEMPLATE_VIS variant
                           ^
/Users/minski/bustache/include/bustache/model.hpp:32:11: note: candidate found by name lookup is 'std::variant'
    class variant;
          ^
/Users/minski/bustache/include/bustache/model.hpp:696:45: error: reference to 'variant' is ambiguous
        static value_ptr get_value_ptr(std::variant<T...> const& self)
                                            ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/variant:1261:28: note: candidate found by name lookup is 'std::__1::variant'
class _LIBCPP_TEMPLATE_VIS variant
                           ^
/Users/minski/bustache/include/bustache/model.hpp:32:11: note: candidate found by name lookup is 'std::variant'
    class variant;
          ^
2 errors generated.

Simply including <variant> in model.hpp fixes the issue for me:

 #include <functional>
+#include <variant>
 #ifdef BUSTACHE_USE_FMT
 #include <fmt/format.h>
 #elif defined(__cpp_lib_format)
@@ -26,11 +27,13 @@
 #include <iterator>
 #endif
 
+/*
 namespace std
 {
     template<class... T>
     class variant;
 };
+*/

What do you think?

from bustache.

jamboree avatar jamboree commented on May 28, 2024

Because the use of std::variant is optional, I tried to avoid unnecessary include if the user doesn't use it.
But technically speaking, one should not forward declare standard types 😥.
What you proposed is absolutely right.

from bustache.

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.