C++: Class specialization a valid transformation for a conforming compiler?

后端 未结 2 2049
感动是毒
感动是毒 2020-12-30 02:06

Hopefully this isn\'t too specialized of a question for StackOverflow: if it is and could be migrated elsewhere let me know...

Many moons ago, I wrote a und

2条回答
  •  温柔的废话
    2020-12-30 02:41

    On first reading, this sounds like a c++-focused variation of polymorphic inline caching. I think that V8 and Oracle's JVM both use it, and I know that .NET does.

    To answer your original question: I don't think there's anything in the standard that forbids these kinds of implementations. C++ takes the "as-is" rule quite seriously; so long as you faithfully implement the right semantics, you can do the implementation in any crazy way you like. c++ virtual calls aren't very complicated, so I doubt you'd trip over any edge cases there either (unlike if, say, you were trying to do something clever with static binding).

提交回复
热议问题