●STL スレッド●
■ このスレッドは過去ログ倉庫に格納されています
0120デフォルトの名無しさん
NGNG#include <algorithm>
#include <iostream>
#include <list>
#include <string>
std::ostream& operator<<(std::ostream& ostream, const struct A& a);
struct A {
std::string name;
std::string tel;
std::string mail;
A(const std::string& name_, const std::string& tel_, const std::string& mail_)
: name(name_), tel(tel_), mail(mail_)
{}
struct Sort {
struct ByName {
inline bool operator()(const A& a1, const A& a2)
{
return a1.name < a2.name;
}
};
struct ByTel {
inline bool operator()(const A& a1, const A& a2)
{
return a1.tel < a2.tel;
}
};
struct ByMail {
inline bool operator()(const A& a1, const A& a2)
{
return a1.mail < a2.mail;
}
};
};
class PrintLn {
std::ostream& ostr;
public:
PrintLn(std::ostream& ostr_ = std::cout)
: ostr(ostr_)
{}
inline void operator()(const A& a)
{
ostr << a << std::endl;
}
};
};
■ このスレッドは過去ログ倉庫に格納されています