Skip to content

Commit

Permalink
Fix the linkage errors caused by duplicate symbols (#1936)
Browse files Browse the repository at this point in the history
  • Loading branch information
adonis0147 authored Oct 14, 2022
1 parent 003b3a4 commit 6fed7b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/butil/class_name.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace butil {

std::string demangle(const char* name);

namespace detail {
namespace {
template <typename T> struct ClassNameHelper { static std::string name; };
template <typename T> std::string ClassNameHelper<T>::name = demangle(typeid(T).name());
}
Expand All @@ -39,7 +39,7 @@ template <typename T> std::string ClassNameHelper<T>::name = demangle(typeid(T).
template <typename T> const std::string& class_name_str() {
// We don't use static-variable-inside-function because before C++11
// local static variable is not guaranteed to be thread-safe.
return detail::ClassNameHelper<T>::name;
return ClassNameHelper<T>::name;
}

// Get name of class |T|, in const char*.
Expand Down

0 comments on commit 6fed7b2

Please sign in to comment.