naiveproxy icon indicating copy to clipboard operation
naiveproxy copied to clipboard

关于-模板参数重新定义默认参数

Open Demon-Cat opened this issue 5 years ago • 1 comments

请教一个问题,就是作者如何解决 /src/third_party/perfetto/include/perfetto/tracing/traced_value_forward.h 中模板参数重新定义默认参数的问题。https://github.com/klzgrad/naiveproxy/blob/697dd24941b7ea566b9123a5348df55e609025bd/src/third_party/perfetto/include/perfetto/tracing/traced_value_forward.h

我似乎在编译时,遇到了

../../third_party/perfetto/include/perfetto/tracing/traced_value_forward.h:29:31: error: template parameter redefines default argument
template <typename T, class = void>
                              ^
../../base/trace_event/base_tracing_forward.h:24:31: note: previous default template argument defined here
template <typename T, class = void>
                              ^
In file included from ../../net/tools/naive/naive_proxy_delegate.cc:11:
In file included from ../../net/http/http_response_headers.h:23:
../../third_party/perfetto/include/perfetto/tracing/traced_value_forward.h:47:45: error: template parameter redefines default argument
template <typename T, typename ResultType = void, class = void>
                                            ^
../../base/trace_event/base_tracing_forward.h:27:45: note: previous default template argument defined here
template <typename T, typename ResultType = void, class = void>
                                            ^
In file included from ../../net/tools/naive/naive_proxy_delegate.cc:11:
In file included from ../../net/http/http_response_headers.h:23:
../../third_party/perfetto/include/perfetto/tracing/traced_value_forward.h:47:59: error: template parameter redefines default argument
template <typename T, typename ResultType = void, class = void>
                                                          ^
../../base/trace_event/base_tracing_forward.h:27:59: note: previous default template argument defined here
template <typename T, typename ResultType = void, class = void>
                                                          ^

Demon-Cat avatar Sep 25 '21 08:09 Demon-Cat

https://github.com/klzgrad/naiveproxy/commit/dd72358ac43074bd6e573047b42bd3c296edf734#diff-3ae44698fed2dabdb76822f682389f838ff1d956478c77cb92e80a7c9db8dc98R13

klzgrad avatar Sep 26 '21 00:09 klzgrad