Skip to content

Commit

Permalink
Delete util::algorithm::raw_type
Browse files Browse the repository at this point in the history
Use
    - std::noskipws or
    - std::istream::unsetf() with std::ios_base::skipws

Signed-off-by: janus_wel <janus.wel.3@gmail.com>
  • Loading branch information
januswel committed Jun 18, 2010
1 parent fc5a6d2 commit e60d38b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
9 changes: 0 additions & 9 deletions header/algorithm.hpp
Expand Up @@ -23,15 +23,6 @@ namespace util {
void operator()(T* p) { delete p; }
};

// for binary operation
struct raw_type { char c; };
inline std::istream& operator >>(std::istream& in, raw_type& r) {
return in.get(r.c);
}
inline std::ostream& operator <<(std::ostream& out, const raw_type& r) {
return out.put(r.c);
}

// copy_if
template< typename InputIterator, typename OstreamIterator,
typename Predicate>
Expand Down
5 changes: 0 additions & 5 deletions sample/algorithm/main.cpp
Expand Up @@ -110,11 +110,6 @@ int main(const int argc, const char* const argv[]) {
util::algorithm::basic_progress<std::string, unsigned int>(
std::cerr, 1, params.size()));

std::cout << "binary operation\n";
std::ifstream fin("main.cpp", std::ios_base::binary);
std::istream_iterator<util::algorithm::raw_type> iitr(fin), end;
util::algorithm::print<util::algorithm::raw_type>(iitr, end, std::cout, "");

std::cerr << std::endl;

return 0;
Expand Down

0 comments on commit e60d38b

Please sign in to comment.