Separate one-off code paths

Posted by DeadMG on Stack Overflow See other posts from Stack Overflow or by DeadMG
Published on 2010-12-24T13:51:07Z Indexed on 2010/12/24 13:54 UTC
Read the original article Hit count: 189

Filed under:

I'm implementing an application with different code paths that shall be chosen once at startup and then fixed forevermore for that execution- for example, choosing D3D11 or D3D9 rendering path. Obviously I don't want to duplicate all my other code. Is run-time inheritance (no virtual inheritance) a fair solution? I don't want to waste a bunch of performance making virtual lookups when the type was fixed long ago. Not just that, but it makes me nervous that the functions can't be inlined and whether or not it affects RVO and NRVO and such. Am I just being over-concerned about this?

© Stack Overflow or respective owner

Related posts about c++0x