Demo entry 1067661

One line palindrome checker

   

Submitted by anonymous on Jan 13, 2015 at 20:18
Language: C++. Code size: 932 Bytes.

#include <string>
#include <algorithm>
#include <iostream>
#include <functional>
#include <iterator>
#include <iomanip>

int main()
  {
  std::transform(std::istream_iterator<std::string>{std::cin}, std::istream_iterator<std::string>{}, std::ostream_iterator<bool>{std::cout}, static_cast<std::function<bool(std::string)>>(bind(&std::equal<std::string::iterator, std::string::reverse_iterator, std::function<bool(char, char)>>, bind(static_cast<std::string::iterator(std::string::*)()>(&std::string::begin), std::placeholders::_1), bind(static_cast<std::string::iterator(std::string::*)()>(&std::string::end), std::placeholders::_1), bind(static_cast<std::string::reverse_iterator(std::string::*)()>(&std::string::rbegin), std::placeholders::_1), static_cast<std::function<bool(char, char)>>(bind(std::equal_to<char>{}, std::bind(&::tolower, std::placeholders::_1), std::bind(&::tolower, std::placeholders::_2))))));
  }

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).