File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
exporters/ostream/include/opentelemetry/exporters/ostream Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ endif()
30
30
31
31
find_package (Threads )
32
32
33
- if (CMAKE_CXX_COMPILER_ID STREQUAL " MSVC" )
33
+ if (MSVC )
34
34
# Options for Visual C++ compiler: /Zc:__cplusplus - report an updated value
35
35
# for recent C++ language standards. Without this option MSVC returns the
36
36
# value of __cplusplus="199711L"
Original file line number Diff line number Diff line change @@ -89,6 +89,9 @@ class OStreamSpanExporter final : public sdktrace::SpanExporter
89
89
sout_ << ' ]' ;
90
90
}
91
91
92
+ // Prior to C++14, generic lambda is not available so fallback to functor.
93
+ #if __cplusplus < 201402L
94
+
92
95
class SpanDataAttributeValueVisitor
93
96
{
94
97
public:
@@ -104,9 +107,15 @@ class OStreamSpanExporter final : public sdktrace::SpanExporter
104
107
OStreamSpanExporter &exporter_;
105
108
};
106
109
110
+ #endif
111
+
107
112
void print_value (sdktrace::SpanDataAttributeValue &value)
108
113
{
114
+ #if __cplusplus < 201402L
109
115
nostd::visit (SpanDataAttributeValueVisitor (*this ), value);
116
+ #else
117
+ nostd::visit ([this ](auto &&arg) { print_value (arg); }, value);
118
+ #endif
110
119
}
111
120
112
121
void printAttributes (std::unordered_map<std::string, sdktrace::SpanDataAttributeValue> map)
You can’t perform that action at this time.
0 commit comments