22 #include <type_traits> 32 static_assert (std::is_pod<ptid_t>::value,
"ptid_t is POD");
36 static_assert (!std::is_convertible<int, ptid_t>::value,
37 "constructor is explicit");
55 static_assert (
pid.
pid () == 1,
"pid's pid is right");
56 static_assert (
lwp.
pid () == 1,
"lwp's pid is right");
57 static_assert (
tid.
pid () == 1,
"tid's pid is right");
58 static_assert (
both.
pid () == 1,
"both's pid is right");
62 static_assert (!
pid.
lwp_p (),
"pid's lwp_p is right");
63 static_assert (
lwp.
lwp_p (),
"lwp's lwp_p is right");
64 static_assert (!
tid.
lwp_p (),
"tid's lwp_p is right");
65 static_assert (
both.
lwp_p (),
"both's lwp_p is right");
69 static_assert (
pid.
lwp () == 0,
"pid's lwp is right");
70 static_assert (
lwp.
lwp () == 2,
"lwp's lwp is right");
71 static_assert (
tid.
lwp () == 0,
"tid's lwp is right");
72 static_assert (
both.
lwp () == 2,
"both's lwp is right");
76 static_assert (!
pid.
tid_p (),
"pid's tid_p is right");
77 static_assert (!
lwp.
tid_p (),
"lwp's tid_p is right");
78 static_assert (
tid.
tid_p (),
"tid's tid_p is right");
79 static_assert (
both.
tid_p (),
"both's tid_p is right");
83 static_assert (
pid.
tid () == 0,
"pid's tid is right");
84 static_assert (
lwp.
tid () == 0,
"lwp's tid is right");
85 static_assert (
tid.
tid () == 2,
"tid's tid is right");
86 static_assert (
both.
tid () == 2,
"both's tid is right");
90 static_assert (
pid.
is_pid (),
"pid is a pid");
91 static_assert (!
lwp.
is_pid (),
"lwp isn't a pid");
92 static_assert (!
tid.
is_pid (),
"tid isn't a pid");
93 static_assert (!
both.
is_pid (),
"both isn't a pid");
94 static_assert (!
null.
is_pid (),
"null ptid isn't a pid");
99 static_assert (
pid ==
ptid_t (1, 0, 0),
"pid operator== is right");
100 static_assert (
lwp ==
ptid_t (1, 2, 0),
"lwp operator== is right");
101 static_assert (
tid ==
ptid_t (1, 0, 2),
"tid operator== is right");
102 static_assert (
both ==
ptid_t (1, 2, 2),
"both operator== is right");
106 static_assert (
pid !=
ptid_t (2, 0, 0),
"pid isn't equal to a different pid");
107 static_assert (
pid !=
lwp,
"pid isn't equal to one of its thread");
108 static_assert (
lwp !=
tid,
"lwp isn't equal to tid");
109 static_assert (
both !=
lwp,
"both isn't equal to lwp");
110 static_assert (
both !=
tid,
"both isn't equal to tid");
125 static_assert (!
ptid_t (2, 0, 0).matches (
pid),
"other pid doesn't match pid");
126 static_assert (!
ptid_t (2, 2, 0).matches (
pid),
"other lwp doesn't match pid");
127 static_assert (!
ptid_t (2, 0, 2).matches (
pid),
"other tid doesn't match pid");
128 static_assert (!
ptid_t (2, 2, 2).matches (
pid),
"other both doesn't match pid");
136 static_assert (!
ptid_t (2, 2, 0).matches (
lwp),
"other lwp doesn't match lwp");
142 static_assert (!
ptid_t (2, 0, 2).matches (
tid),
"other tid doesn't match tid");
148 static_assert (!
ptid_t (2, 2, 2).matches (
both),
149 "other both doesn't match both");
constexpr int pid() const
constexpr long lwp() const
static constexpr ptid_t tid
static constexpr ptid_t pid
constexpr bool matches(const ptid_t &filter) const
constexpr bool tid_p() const
static constexpr ptid_t minus_one
static constexpr ptid_t make_null()
static constexpr ptid_t null
constexpr bool lwp_p() const
static constexpr ptid_t lwp
constexpr bool is_pid() const
constexpr long tid() const
static constexpr ptid_t make_minus_one()
static constexpr ptid_t both