C++ compile time function execution

后端 未结 6 1673
醉酒成梦
醉酒成梦 2021-01-02 02:41

I have string tags in my code that are converted to numbers and used to search values in a tag-value structure.

I have something like this:

void foo(         


        
6条回答
  •  臣服心动
    2021-01-02 03:26

    Althrough not compile time, I think this is fast enough for you;

    void foo()
    {
        const static auto someTagN = toNumber("SomeTag");
        type value = internal_search(someTagN );
    }
    

提交回复
热议问题