boost-ext / te

C++17 Run-time Polymorphism (Type Erasure) library
463 stars 39 forks source link

te::call compile error under windows environment #45

Open zyzyz opened 2 months ago

zyzyz commented 2 months ago

Expected Behavior

te.hpp file compiles in a project using Windows SDK

Actual Behavior

te::call has a compile error

struct Drawable : te::poly<Drawable> {
    using te::poly<Drawable>::poly;

    void draw(std::ostream &out) const {
        te::call([](auto const &self, auto &out) { self.draw(out); }, *this, out);
                                                                             ~~~
    }
};
constexpr auto call(
  const TExpr expr,
  const I &interface,
           ~~~~~~~~~
  Ts &&... args)
{...}

argument interface is recognized as macro defined in combaseapi.h, changing to other naming compiles.

Adjusting including order or using precompiled header might help, but considering interface is a common keyword, it is expected to change the argument naming for better compatibility.

Specifications