venera13 / oop

0 stars 0 forks source link

Замечания по программе Crypt #4

Open alexey-malov opened 4 years ago

alexey-malov commented 4 years ago
alexey-malov commented 4 years ago
alexey-malov commented 4 years ago

https://github.com/venera13/oop/blob/0744c8f7c2a1993504ad84588aed509374ab90ec/lab1/Crypt/Crypt.cpp#L134-L137

alexey-malov commented 4 years ago

https://github.com/venera13/oop/blob/0744c8f7c2a1993504ad84588aed509374ab90ec/lab1/Crypt/Crypt.cpp#L79

alexey-malov commented 4 years ago

https://github.com/venera13/oop/blob/0744c8f7c2a1993504ad84588aed509374ab90ec/lab1/Crypt/Crypt.cpp#L9-L15

alexey-malov commented 4 years ago

https://github.com/venera13/oop/blob/0744c8f7c2a1993504ad84588aed509374ab90ec/lab1/Crypt/Crypt.cpp#L110-L120

if (args.mode == Mode.Crypt) { TransformStream(input, output, [key = args.key](char ch) { return Encrypt(char, key); }); } else { TransformStream(input, output, [key = args.key](char ch) { return Decrypt(char, key); }); }


либо даже:
```c++
#include <iterator>
std::transform(
    std::istream_iterator<char>(input), (istream_iterator<char>()),
    std::ostream_iterator<char>(output),
     [key = args.key](char ch) {
      return Decrypt(char, key);
  });