fork download
  1. #include <boost/range/adaptor/transformed.hpp>
  2. #include <cctype>
  3. #include <string>
  4. #include <iostream>
  5.  
  6. int main()
  7. {
  8. const std::string input = "Hello, World!";
  9. const auto& transformed = boost::adaptors::transform(input, ::toupper);
  10. const std::string output(transformed.begin(), transformed.end());
  11.  
  12. std::cout << input << " -> " << output << std::endl;
  13. }
Success #stdin #stdout 0s 4476KB
stdin
Standard input is empty
stdout
Hello, World! -> HELLO, WORLD!