const-ness as template argument

后端 未结 3 1055
遇见更好的自我
遇见更好的自我 2021-02-07 23:59

I have two structs:

  // ----- non-const -----
  struct arg_adapter
  {
      EArgType type;  // fmtA, fmtB, ...

      union
      {
        TypeA * valueA;
            


        
3条回答
  •  南笙
    南笙 (楼主)
    2021-02-08 01:01

    Maybe I didn't get it, but why can't you use

    Convert(**const** arg_adapter from, arg_adapter to)
    

    Declare a typedef to simplify the job

提交回复
热议问题