Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vectors and Family<T>.Add() #658

Open
carlosatrios opened this issue Sep 6, 2023 · 0 comments
Open

Vectors and Family<T>.Add() #658

carlosatrios opened this issue Sep 6, 2023 · 0 comments

Comments

@carlosatrios
Copy link

@gjasny In a similar vain to #380, are you expected to interact with vectors in a similar way? I can't get the output of Add to play nice with any variation of vector.

  using Families = std::variant<std::reference_wrapper<Family<Counter>>, std::reference_wrapper<Family<Gauge>>, std::reference_wrapper<Family<Histogram>>, std::reference_wrapper<Family<Summary>>>;
  std::map<std::string, Families> metricsMap;

auto& histogram = BuildHistogram().Name("some_histogram").Help("Some Histogram").Register(*registry);
  metricsMap.emplace(histogram.GetName(), histogram);

std::vector<Families> example;
example.push_back(histogram.Add({{"example", "example"}});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant