Giter Site home page Giter Site logo

Comments (1)

roystgnr avatar roystgnr commented on July 4, 2024

Oh, that's nasty.

I think the real fix is to make enum_to_string stop relying on just-in-time creation of those maps. I'm sure the existing code is little more than an artifact of static maps being a pain to initialize in C++98; we should have upgraded it as soon as we started requiring compilers with std::initializer_list support.

Ideally the constructor itself would be at compile-time, since there's nothing that varies from run to run about it ... but even constexpr std::vector is a C++20 thing and I don't see any constexpr std::map on the horizon. No matter; these are such small maps that just initializing a couple dozen of them in static constructors should be negligible cost, and they don't depend on any other objects so there should be no static constructor initialization order to worry about.

...

I hope? We don't have any other static objects that depend on these maps, surely? I'll need to leave a libmesh_assert(!foo.empty()) in the conversion routines to guard against that...

from libmesh.

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.