Replies: 1 comment
-
I guess what I need is sort of the opposite of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a large collection of template-heavy free functions, something like:
And wrapping them works fine with:
The compiler requires a frankly ridiculous amount of RAM (10 GB or more) to compile my library where maybe there are 8 model types, and 20 functions. The problem is most severe with MSVC, but not only. Of course deeply nested template libraries are a big part of the problem here.
I think part of the problem is that the overload resolution of
foo
,bar
, ... are causing trouble for the compiler. I am therefore trying to figure out how to attach all the free functions to instances of model in the interface because method lookup on an instance is much, much faster than overload resolution on a free function. I tried to make a wrapper class something likebut it doesn't work and I get pages of compilation errors. I think the issue is I don't know how to pass along something like
&foo
to be held and then used by the wrapper class. I'd like to have tens or hundreds of model types, which is currently unfeasible.Of course, writing lambda functions to hoist free functions into the instance is possible, if VERY tedious:
Beta Was this translation helpful? Give feedback.
All reactions