This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme.

01 Implement pipe operator

Requirements

  1. Please don’t change main function.
  2. Please implement your function/code to get Expected results.
1
2
3
4
5
6
7
int main()
{
    std::vector v{1, 2, 3};
    std::function f {[](const int& i) {std::cout << i << ' '; } };
    auto f2 = [](int& i) {i *= i; };
    v | f2 | f;
}

Expected results

1 4 9

Suggested environments

Compiler explorer, please add –std=c++20 to the compilation options.

My implementation

Reference code, please use browser to translate page from Chinese to English if necessary.