Skip to content

Crash when running basic shape example with MSVC #46

@benjamind2330

Description

@benjamind2330

The basic example:

struct Drawable {
  void draw(std::ostream &out) const {
    te::call([](auto const &self, auto &out) { self.draw(out); }, *this, out);
  }
};

struct Square {
  void draw(std::ostream &out) const { out << "Square"; }
};

int main() {
   
    Square s;
    te::poly<Drawable> d{s};
    d.draw(std::cout);
    return 0;
}

Crashes at runtime when compiled with MSVC. See the live example here:
https://godbolt.org/z/znrPGjxK6

A question about this is also open here:
https://stackoverflow.com/questions/78037810/boost-te-memory-access-failure-with-visual-c

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions