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

Can not support std::vector<std::string> ? #30

Open
consolexinhun opened this issue Jul 10, 2023 · 0 comments
Open

Can not support std::vector<std::string> ? #30

consolexinhun opened this issue Jul 10, 2023 · 0 comments

Comments

@consolexinhun
Copy link

#include <iostream>
#include <vector>
#include "cmdline.h"

int main(int argc, char** argv) {
  cmdline::parser parser;

  parser.add<std::vector<std::string>>("topics", 't', "topics to filter", true);

  parser.parse(argc, argv);

  std::vector<std::string> topics = parser.get<std::vector<std::string>>("topics");

  std::cout << "Topics to filter:" << std::endl;
  for (const auto& topic : topics) {
    std::cout << "- " << topic << std::endl;
  }

  return 0;
}

this code is compile error,how to support for std::vectorstd::string?

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