Skip to content

Need fine-grained HAVE_CPP_STDLIB #1071

@hcoona

Description

@hcoona

Is your feature request related to a problem?

The std::shared_ptr & std::unique_ptr are well-supported by wide-spread compilers in c++11, while std::string_view & std::variant are unavailable until c++17. We currently use a coarse-grained switch HAVE_CPP_STDLIB to control all these things. As a result, we cannot enable any of them.

Using our private implemented nonstd::shared_ptr would lead to interoperability issue with std::shared_ptr, which is quite annoying.

Describe the solution you'd like

I'd like to split HAVE_CPP_STDLIB into more fine-grained switches:

  • OPENTELEMETRY_HAVE_CXX11
    • OPENTELEMETRY_HAVE_STD_SHARED_PTR
    • OPENTELEMETRY_HAVE_STD_UNIQUE_PTR
  • OPENTELEMETRY_HAVE_CXX17
    • OPENTELEMETRY_HAVE_STD_STRING_VIEW
    • OPENTELEMETRY_HAVE_STD_VARIANT
  • OPENTELEMETRY_HAVE_CXX20
    • OPENTELEMETRY_HAVE_STD_SPAN

Describe alternatives you've considered

Didn't find a better approach.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions