Topic: true_predicate and false_predicate


Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Wed, 2 Oct 2013 17:20:17 -0700 (PDT)
Raw View
------=_Part_681_1304169.1380759617099
Content-Type: text/plain; charset=ISO-8859-1

Is there in the Standard dummy default unary predicates something as
true_predicate and false_predicate?

For example

template <class T>

struct true_predicate
{
   bool operator ()( const T & ) const { return true; }
   typedef T argument_type;
   typedef bool result_type;
};

template <class T>

struct false_predicate
{
   bool operator ()( const T & ) const { return false; }
   typedef T argument_type;
   typedef bool result_type;
};


If there is no such constructions in C++ Standard I would make a proposal.

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_681_1304169.1380759617099
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Is there in the Standard dummy default unary predicat=
es&nbsp;something as true_predicate and false_predicate?</div><div>&nbsp;</=
div><div>For example</div><div>&nbsp;</div><div>template &lt;class T&gt;</d=
iv><div>&nbsp;</div><div>struct true_predicate</div><div>{</div><div>&nbsp;=
&nbsp; bool operator ()( const T &amp; ) const { return true; }</div><div>&=
nbsp;&nbsp; typedef T argument_type;</div><div>&nbsp;&nbsp; typedef bool re=
sult_type;</div><div>};</div><div>&nbsp;</div><div><div>template &lt;class =
T&gt;</div><div>&nbsp;</div><div>struct false_predicate</div><div>{</div><d=
iv>&nbsp;&nbsp; bool operator ()( const T &amp; ) const { return false; }</=
div><div>&nbsp;&nbsp; typedef T argument_type;</div><div>&nbsp;&nbsp; typed=
ef bool result_type;</div><div>};</div></div><div>&nbsp;</div><div>&nbsp;</=
div><div>If there is no such constructions in C++ Standard I would make a p=
roposal.</div></div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_681_1304169.1380759617099--

.


Author: "Billy O'Neal" <billy.oneal@gmail.com>
Date: Wed, 2 Oct 2013 17:54:42 -0700
Raw View
--90e6ba539e70f723d904e7cba3b0
Content-Type: text/plain; charset=ISO-8859-1

In keeping with the spirit of Stephan's Making Operator Functions Greater<>
proposal, I'd move the template parameter into the operator():

template <class T = void>
struct true_predicate
{
   bool operator ()( const T & ) const { return true; }
   typedef T argument_type;
   typedef bool result_type;
};

template <>
struct true_predicate<void>
{
   template <typename U>
   bool operator ()( const U & ) const { return true; }
};

template <class T = void>
struct false_predicate
{
   bool operator ()( const T & ) const { return false; }
   typedef T argument_type;
   typedef bool result_type;
};

template <>
struct false_predicate<void>
{
   template <typename U>
   bool operator ()( const U & ) const { return false; }
};


Billy O'Neal
https://github.com/BillyONeal/ <https://bitbucket.org/BillyONeal/>
http://stackoverflow.com/users/82320/billy-oneal
Malware Response Instructor - BleepingComputer.com


On Wed, Oct 2, 2013 at 5:20 PM, Vlad from Moscow <vlad.moscow@mail.ru>wrote:

> Is there in the Standard dummy default unary predicates something as
> true_predicate and false_predicate?
>
> For example
>
> template <class T>
>
> struct true_predicate
> {
>    bool operator ()( const T & ) const { return true; }
>    typedef T argument_type;
>    typedef bool result_type;
> };
>
> template <class T>
>
> struct false_predicate
> {
>    bool operator ()( const T & ) const { return false; }
>    typedef T argument_type;
>    typedef bool result_type;
> };
>
>
> If there is no such constructions in C++ Standard I would make a proposal.
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

--90e6ba539e70f723d904e7cba3b0
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">In keeping with the spirit of Stephan&#39;s Making Operato=
r Functions Greater&lt;&gt; proposal, I&#39;d move the template parameter i=
nto the operator():<div><br></div><div><div>template &lt;class T =3D void&g=
t;</div>

<div>struct true_predicate</div><div>{</div><div>=A0 =A0bool operator ()( c=
onst T &amp; ) const { return true; }</div><div>=A0 =A0typedef T argument_t=
ype;</div><div>=A0 =A0typedef bool result_type;</div><div>};</div><div><br>=
</div><div>

template &lt;&gt;</div><div>struct true_predicate&lt;void&gt;</div><div>{</=
div><div>=A0 =A0template &lt;typename U&gt;</div><div>=A0 =A0bool operator =
()( const U &amp; ) const { return true; }</div><div>};</div><div>=A0</div>=
<div>
template &lt;class T =3D void&gt;</div>
<div>struct false_predicate</div><div>{</div><div>=A0 =A0bool operator ()( =
const T &amp; ) const { return false; }</div><div>=A0 =A0typedef T argument=
_type;</div><div>=A0 =A0typedef bool result_type;</div><div>};</div><div><b=
r></div>

<div>template &lt;&gt;</div><div>struct false_predicate&lt;void&gt;</div><d=
iv>{</div><div>=A0 =A0template &lt;typename U&gt;</div><div>=A0 =A0bool ope=
rator ()( const U &amp; ) const { return false; }</div><div>};</div></div><=
div>

<br></div></div><div class=3D"gmail_extra"><br clear=3D"all"><div><div dir=
=3D"ltr"><div>Billy O&#39;Neal</div><div><a href=3D"https://bitbucket.org/B=
illyONeal/" target=3D"_blank">https://github.com/BillyONeal/</a></div><div>=
<a href=3D"http://stackoverflow.com/users/82320/billy-oneal" target=3D"_bla=
nk">http://stackoverflow.com/users/82320/billy-oneal</a></div>

<div>Malware Response Instructor - BleepingComputer.com</div></div></div>
<br><br><div class=3D"gmail_quote">On Wed, Oct 2, 2013 at 5:20 PM, Vlad fro=
m Moscow <span dir=3D"ltr">&lt;<a href=3D"mailto:vlad.moscow@mail.ru" targe=
t=3D"_blank">vlad.moscow@mail.ru</a>&gt;</span> wrote:<br><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex">

<div dir=3D"ltr"><div>Is there in the Standard dummy default unary predicat=
es=A0something as true_predicate and false_predicate?</div><div>=A0</div><d=
iv>For example</div><div>=A0</div><div>template &lt;class T&gt;</div><div>=
=A0</div>

<div>struct true_predicate</div><div>{</div><div>=A0=A0 bool operator ()( c=
onst T &amp; ) const { return true; }</div><div>=A0=A0 typedef T argument_t=
ype;</div><div>=A0=A0 typedef bool result_type;</div><div>};</div><div>=A0<=
/div><div>

<div>template &lt;class T&gt;</div><div>=A0</div><div>struct false_predicat=
e</div><div>{</div><div>=A0=A0 bool operator ()( const T &amp; ) const { re=
turn false; }</div><div>=A0=A0 typedef T argument_type;</div><div>=A0=A0 ty=
pedef bool result_type;</div>

<div>};</div></div><div>=A0</div><div>=A0</div><div>If there is no such con=
structions in C++ Standard I would make a proposal.</div></div><span class=
=3D"HOEnZb"><font color=3D"#888888">

<p></p>

-- <br>
=A0<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals%2Bunsubscribe@isocpp.org" target=3D=
"_blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</font></span></blockquote></div><br></div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--90e6ba539e70f723d904e7cba3b0--

.


Author: Jeffrey Yasskin <jyasskin@google.com>
Date: Wed, 2 Oct 2013 17:57:04 -0700
Raw View
"[](const auto&){return true;}"  ?

On Wed, Oct 2, 2013 at 5:20 PM, Vlad from Moscow <vlad.moscow@mail.ru> wrote:
> Is there in the Standard dummy default unary predicates something as
> true_predicate and false_predicate?
>
> For example
>
> template <class T>
>
> struct true_predicate
> {
>    bool operator ()( const T & ) const { return true; }
>    typedef T argument_type;
>    typedef bool result_type;
> };
>
> template <class T>
>
> struct false_predicate
> {
>    bool operator ()( const T & ) const { return false; }
>    typedef T argument_type;
>    typedef bool result_type;
> };
>
>
> If there is no such constructions in C++ Standard I would make a proposal.
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.


Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Wed, 2 Oct 2013 18:03:19 -0700 (PDT)
Raw View
------=_Part_3974_14529890.1380762199422
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

As I have understood from my other thread in forum Standard discusiion this=
=20
lambda expression can be used as a type template parameter.
=20

=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 4:57:04 UTC+4 =D0=
=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Jeffrey Yasskin=20
=CE=C1=D0=C9=D3=C1=CC:

> "[](const auto&){return true;}"  ?=20
>
> On Wed, Oct 2, 2013 at 5:20 PM, Vlad from Moscow <vlad....@mail.ru<javasc=
ript:>>=20
> wrote:=20
> > Is there in the Standard dummy default unary predicates something as=20
> > true_predicate and false_predicate?=20
> >=20
> > For example=20
> >=20
> > template <class T>=20
> >=20
> > struct true_predicate=20
> > {=20
> >    bool operator ()( const T & ) const { return true; }=20
> >    typedef T argument_type;=20
> >    typedef bool result_type;=20
> > };=20
> >=20
> > template <class T>=20
> >=20
> > struct false_predicate=20
> > {=20
> >    bool operator ()( const T & ) const { return false; }=20
> >    typedef T argument_type;=20
> >    typedef bool result_type;=20
> > };=20
> >=20
> >=20
> > If there is no such constructions in C++ Standard I would make a=20
> proposal.=20
> >=20
> > --=20
> >=20
> > ---=20
> > You received this message because you are subscribed to the Google=20
> Groups=20
> > "ISO C++ Standard - Future Proposals" group.=20
> > To unsubscribe from this group and stop receiving emails from it, send=
=20
> an=20
> > email to std-proposal...@isocpp.org <javascript:>.=20
> > To post to this group, send email to std-pr...@isocpp.org <javascript:>=
..=20
>
> > Visit this group at=20
> > http://groups.google.com/a/isocpp.org/group/std-proposals/.=20
>

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_3974_14529890.1380762199422
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>As I have understood from my other thread in forum St=
andard discusiion this lambda expression can be used as a type template par=
ameter.</div><div>&nbsp;</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=
=D1=C2=D2=D1 2013&nbsp;=C7., 4:57:04 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=
=CC=D8 Jeffrey Yasskin =CE=C1=D0=C9=D3=C1=CC:</div><blockquote class=3D"gma=
il_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-lef=
t-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: sol=
id;">"[](const auto&amp;){return true;}" &nbsp;?
<br>
<br>On Wed, Oct 2, 2013 at 5:20 PM, Vlad from Moscow &lt;<a href=3D"javascr=
ipt:" target=3D"_blank" gdf-obfuscated-mailto=3D"XiEDthncqRQJ">vlad....@mai=
l.ru</a>&gt; wrote:
<br>&gt; Is there in the Standard dummy default unary predicates something =
as
<br>&gt; true_predicate and false_predicate?
<br>&gt;
<br>&gt; For example
<br>&gt;
<br>&gt; template &lt;class T&gt;
<br>&gt;
<br>&gt; struct true_predicate
<br>&gt; {
<br>&gt; &nbsp; &nbsp;bool operator ()( const T &amp; ) const { return true=
; }
<br>&gt; &nbsp; &nbsp;typedef T argument_type;
<br>&gt; &nbsp; &nbsp;typedef bool result_type;
<br>&gt; };
<br>&gt;
<br>&gt; template &lt;class T&gt;
<br>&gt;
<br>&gt; struct false_predicate
<br>&gt; {
<br>&gt; &nbsp; &nbsp;bool operator ()( const T &amp; ) const { return fals=
e; }
<br>&gt; &nbsp; &nbsp;typedef T argument_type;
<br>&gt; &nbsp; &nbsp;typedef bool result_type;
<br>&gt; };
<br>&gt;
<br>&gt;
<br>&gt; If there is no such constructions in C++ Standard I would make a p=
roposal.
<br>&gt;
<br>&gt; --
<br>&gt;
<br>&gt; ---
<br>&gt; You received this message because you are subscribed to the Google=
 Groups
<br>&gt; "ISO C++ Standard - Future Proposals" group.
<br>&gt; To unsubscribe from this group and stop receiving emails from it, =
send an
<br>&gt; email to <a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-=
mailto=3D"XiEDthncqRQJ">std-proposal...@<wbr>isocpp.org</a>.
<br>&gt; To post to this group, send email to <a href=3D"javascript:" targe=
t=3D"_blank" gdf-obfuscated-mailto=3D"XiEDthncqRQJ">std-pr...@isocpp.org</a=
>.
<br>&gt; Visit this group at
<br>&gt; <a href=3D"http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/" target=3D"_blank">http://groups.google.com/a/<wbr>isocpp.org/group/std=
-<wbr>proposals/</a>.
<br></blockquote></div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_3974_14529890.1380762199422--

.


Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Wed, 2 Oct 2013 19:12:47 -0700 (PDT)
Raw View
------=_Part_708_19888892.1380766367501
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

=20
Maybe something as
=20
template <class T>
struct false_predicate
{
 constexpr bool operator ()( const T &... ) const { return ( false ); }
 typedef T    argument_type;
 typedef bool result_type;
};

=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 4:20:17 UTC+4 =D0=
=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
=CE=C1=D0=C9=D3=C1=CC:

> Is there in the Standard dummy default unary predicates something as=20
> true_predicate and false_predicate?
> =20
> For example
> =20
> template <class T>
> =20
> struct true_predicate
> {
>    bool operator ()( const T & ) const { return true; }
>    typedef T argument_type;
>    typedef bool result_type;
> };
> =20
> template <class T>
> =20
> struct false_predicate
> {
>    bool operator ()( const T & ) const { return false; }
>    typedef T argument_type;
>    typedef bool result_type;
> };
> =20
> =20
> If there is no such constructions in C++ Standard I would make a proposal=
..
>

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_708_19888892.1380766367501
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>&nbsp;</div><div>Maybe something as</div><div>&nbsp;<=
/div><div>template &lt;class T&gt;<br>struct false_predicate<br>{<br>&nbsp;=
constexpr bool operator ()( const T &amp;... ) const { return ( false ); }<=
br>&nbsp;typedef T&nbsp;&nbsp;&nbsp; argument_type;<br>&nbsp;typedef bool r=
esult_type;<br>};</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=
=D1 2013&nbsp;=C7., 4:20:17 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad=
 from Moscow =CE=C1=D0=C9=D3=C1=CC:</div><blockquote class=3D"gmail_quote" =
style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: r=
gb(204, 204, 204); border-left-width: 1px; border-left-style: solid;"><div =
dir=3D"ltr"><div>Is there in the Standard dummy default unary predicates&nb=
sp;something as true_predicate and false_predicate?</div><div>&nbsp;</div><=
div>For example</div><div>&nbsp;</div><div>template &lt;class T&gt;</div><d=
iv>&nbsp;</div><div>struct true_predicate</div><div>{</div><div>&nbsp;&nbsp=
; bool operator ()( const T &amp; ) const { return true; }</div><div>&nbsp;=
&nbsp; typedef T argument_type;</div><div>&nbsp;&nbsp; typedef bool result_=
type;</div><div>};</div><div>&nbsp;</div><div><div>template &lt;class T&gt;=
</div><div>&nbsp;</div><div>struct false_predicate</div><div>{</div><div>&n=
bsp;&nbsp; bool operator ()( const T &amp; ) const { return false; }</div><=
div>&nbsp;&nbsp; typedef T argument_type;</div><div>&nbsp;&nbsp; typedef bo=
ol result_type;</div><div>};</div></div><div>&nbsp;</div><div>&nbsp;</div><=
div>If there is no such constructions in C++ Standard I would make a propos=
al.</div></div></blockquote></div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_708_19888892.1380766367501--

.


Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Thu, 3 Oct 2013 03:01:07 -0700 (PDT)
Raw View
------=_Part_6407_8929011.1380794467384
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

If this code is valid then false_predicate (and correspondingly=20
true_predicate) could be defined the following way. At least this code is=
=20
compiled with GCC
=20
template <class ...T> struct false_predicate;
template <class T> struct false_predicate<T>=20
{
 typedef T    argument_type;
 typedef bool result_type;
 constexpr bool operator ()( const T & ) const=20
 {=20
  return ( false );=20
 }
=20
};
template <class T, class U> struct false_predicate<T, U>=20
{
 typedef T    first_argument_type;
 typedef U    second_argument_type;
 typedef bool result_type;
 constexpr bool operator ()( const T &, const U & ) const=20
 {=20
  return ( false );=20
 }
};
=20

=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 6:12:47 UTC+4 =D0=
=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
=CE=C1=D0=C9=D3=C1=CC:

> =20
> Maybe something as
> =20
> template <class T>
> struct false_predicate
> {
>  constexpr bool operator ()( const T &... ) const { return ( false ); }
>  typedef T    argument_type;
>  typedef bool result_type;
> };
>
> =DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 4:20:17 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
> =CE=C1=D0=C9=D3=C1=CC:
>
>> Is there in the Standard dummy default unary predicates something as=20
>> true_predicate and false_predicate?
>> =20
>> For example
>> =20
>> template <class T>
>> =20
>> struct true_predicate
>> {
>>    bool operator ()( const T & ) const { return true; }
>>    typedef T argument_type;
>>    typedef bool result_type;
>> };
>> =20
>> template <class T>
>> =20
>> struct false_predicate
>> {
>>    bool operator ()( const T & ) const { return false; }
>>    typedef T argument_type;
>>    typedef bool result_type;
>> };
>> =20
>> =20
>> If there is no such constructions in C++ Standard I would make a proposa=
l.
>>
>

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_6407_8929011.1380794467384
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>If this code is valid then false_predicate (and corre=
spondingly true_predicate) could be defined the following way. At least thi=
s code is compiled with GCC</div><div>&nbsp;</div><div>template &lt;class .=
...T&gt; struct false_predicate;<br>template &lt;class T&gt; struct false_pr=
edicate&lt;T&gt; <br>{<br>&nbsp;typedef T&nbsp;&nbsp;&nbsp; argument_type;<=
br>&nbsp;typedef bool result_type;<br>&nbsp;constexpr bool operator ()( con=
st T &amp; ) const <br>&nbsp;{ <br>&nbsp;&nbsp;return ( false ); <br>&nbsp;=
}<br>&nbsp;<br>};<br>template &lt;class T, class U&gt; struct false_predica=
te&lt;T, U&gt; <br>{<br>&nbsp;typedef T&nbsp;&nbsp;&nbsp; first_argument_ty=
pe;<br>&nbsp;typedef U&nbsp;&nbsp;&nbsp; second_argument_type;<br>&nbsp;typ=
edef bool result_type;<br>&nbsp;constexpr bool operator ()( const T &amp;, =
const U &amp; ) const <br>&nbsp;{ <br>&nbsp;&nbsp;return ( false ); <br>&nb=
sp;}<br>};</div><div>&nbsp;</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=
=D4=D1=C2=D2=D1 2013&nbsp;=C7., 6:12:47 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=
=C5=CC=D8 Vlad from Moscow =CE=C1=D0=C9=D3=C1=CC:</div><blockquote class=3D=
"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border=
-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style:=
 solid;"><div dir=3D"ltr"><div>&nbsp;</div><div>Maybe something as</div><di=
v>&nbsp;</div><div>template &lt;class T&gt;<br>struct false_predicate<br>{<=
br>&nbsp;constexpr bool operator ()( const T &amp;... ) const { return ( fa=
lse ); }<br>&nbsp;typedef T&nbsp;&nbsp;&nbsp; argument_type;<br>&nbsp;typed=
ef bool result_type;<br>};</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=
=D1=C2=D2=D1 2013&nbsp;=C7., 4:20:17 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=
=CC=D8 Vlad from Moscow =CE=C1=D0=C9=D3=C1=CC:</div><blockquote class=3D"gm=
ail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-le=
ft-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: so=
lid;"><div dir=3D"ltr"><div>Is there in the Standard dummy default unary pr=
edicates&nbsp;something as true_predicate and false_predicate?</div><div>&n=
bsp;</div><div>For example</div><div>&nbsp;</div><div>template &lt;class T&=
gt;</div><div>&nbsp;</div><div>struct true_predicate</div><div>{</div><div>=
&nbsp;&nbsp; bool operator ()( const T &amp; ) const { return true; }</div>=
<div>&nbsp;&nbsp; typedef T argument_type;</div><div>&nbsp;&nbsp; typedef b=
ool result_type;</div><div>};</div><div>&nbsp;</div><div><div>template &lt;=
class T&gt;</div><div>&nbsp;</div><div>struct false_predicate</div><div>{</=
div><div>&nbsp;&nbsp; bool operator ()( const T &amp; ) const { return fals=
e; }</div><div>&nbsp;&nbsp; typedef T argument_type;</div><div>&nbsp;&nbsp;=
 typedef bool result_type;</div><div>};</div></div><div>&nbsp;</div><div>&n=
bsp;</div><div>If there is no such constructions in C++ Standard I would ma=
ke a proposal.</div></div></blockquote></div></blockquote></div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_6407_8929011.1380794467384--

.


Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Thu, 3 Oct 2013 03:27:09 -0700 (PDT)
Raw View
------=_Part_89_13520779.1380796029666
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

it would be not bad to use this idiom however how in the class=20
specialization to define first_argument_type and second_argument_type?
=20

=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 4:54:42 UTC+4 =D0=
=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Billy O'Neal =CE=C1=D0=C9=D3=C1=CC:

> In keeping with the spirit of Stephan's Making Operator Functions=20
> Greater<> proposal, I'd move the template parameter into the operator():
>
> template <class T =3D void>
> struct true_predicate
> {
>    bool operator ()( const T & ) const { return true; }
>    typedef T argument_type;
>    typedef bool result_type;
> };
>
> template <>
> struct true_predicate<void>
> {
>    template <typename U>
>    bool operator ()( const U & ) const { return true; }
> };
> =20
> template <class T =3D void>
> struct false_predicate
> {
>    bool operator ()( const T & ) const { return false; }
>    typedef T argument_type;
>    typedef bool result_type;
> };
>
> template <>
> struct false_predicate<void>
> {
>    template <typename U>
>    bool operator ()( const U & ) const { return false; }
> };
>
>
> Billy O'Neal
> https://github.com/BillyONeal/ <https://bitbucket.org/BillyONeal/>
> http://stackoverflow.com/users/82320/billy-oneal
> Malware Response Instructor - BleepingComputer.com
>
>
> On Wed, Oct 2, 2013 at 5:20 PM, Vlad from Moscow <vlad....@mail.ru<javasc=
ript:>
> > wrote:
>
>> Is there in the Standard dummy default unary predicates something as=20
>> true_predicate and false_predicate?
>> =20
>> For example
>> =20
>> template <class T>
>> =20
>> struct true_predicate
>> {
>>    bool operator ()( const T & ) const { return true; }
>>    typedef T argument_type;
>>    typedef bool result_type;
>> };
>> =20
>> template <class T>
>> =20
>> struct false_predicate
>> {
>>    bool operator ()( const T & ) const { return false; }
>>    typedef T argument_type;
>>    typedef bool result_type;
>> };
>> =20
>> =20
>> If there is no such constructions in C++ Standard I would make a proposa=
l.
>>
>> --=20
>> =20
>> ---=20
>> You received this message because you are subscribed to the Google Group=
s=20
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n=20
>> email to std-proposal...@isocpp.org <javascript:>.
>> To post to this group, send email to std-pr...@isocpp.org <javascript:>.
>> Visit this group at=20
>> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>>
>
>

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_89_13520779.1380796029666
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>it would be not bad to use this idiom however how in =
the class specialization to define first_argument_type and second_argument_=
type?</div><div>&nbsp;</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=
=C2=D2=D1 2013&nbsp;=C7., 4:54:42 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=
=D8 Billy O'Neal =CE=C1=D0=C9=D3=C1=CC:</div><blockquote class=3D"gmail_quo=
te" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-colo=
r: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;"><=
div dir=3D"ltr">In keeping with the spirit of Stephan's Making Operator Fun=
ctions Greater&lt;&gt; proposal, I'd move the template parameter into the o=
perator():<div><br></div><div><div>template &lt;class T =3D void&gt;</div>

<div>struct true_predicate</div><div>{</div><div>&nbsp; &nbsp;bool operator=
 ()( const T &amp; ) const { return true; }</div><div>&nbsp; &nbsp;typedef =
T argument_type;</div><div>&nbsp; &nbsp;typedef bool result_type;</div><div=
>};</div><div><br></div><div>

template &lt;&gt;</div><div>struct true_predicate&lt;void&gt;</div><div>{</=
div><div>&nbsp; &nbsp;template &lt;typename U&gt;</div><div>&nbsp; &nbsp;bo=
ol operator ()( const U &amp; ) const { return true; }</div><div>};</div><d=
iv>&nbsp;</div><div>
template &lt;class T =3D void&gt;</div>
<div>struct false_predicate</div><div>{</div><div>&nbsp; &nbsp;bool operato=
r ()( const T &amp; ) const { return false; }</div><div>&nbsp; &nbsp;typede=
f T argument_type;</div><div>&nbsp; &nbsp;typedef bool result_type;</div><d=
iv>};</div><div><br></div>

<div>template &lt;&gt;</div><div>struct false_predicate&lt;void&gt;</div><d=
iv>{</div><div>&nbsp; &nbsp;template &lt;typename U&gt;</div><div>&nbsp; &n=
bsp;bool operator ()( const U &amp; ) const { return false; }</div><div>};<=
/div></div><div>

<br></div></div><div><br clear=3D"all"><div><div dir=3D"ltr"><div>Billy O'N=
eal</div><div><a href=3D"https://bitbucket.org/BillyONeal/" target=3D"_blan=
k">https://github.com/BillyONeal/</a></div><div><a href=3D"http://stackover=
flow.com/users/82320/billy-oneal" target=3D"_blank">http://stackoverflow.co=
m/<wbr>users/82320/billy-oneal</a></div>

<div>Malware Response Instructor - BleepingComputer.com</div></div></div>
<br><br><div class=3D"gmail_quote">On Wed, Oct 2, 2013 at 5:20 PM, Vlad fro=
m Moscow <span dir=3D"ltr">&lt;<a href=3D"javascript:" target=3D"_blank" gd=
f-obfuscated-mailto=3D"szUkhVX_A0EJ">vlad....@mail.ru</a>&gt;</span> wrote:=
<br><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; p=
adding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width:=
 1px; border-left-style: solid;">

<div dir=3D"ltr"><div>Is there in the Standard dummy default unary predicat=
es&nbsp;something as true_predicate and false_predicate?</div><div>&nbsp;</=
div><div>For example</div><div>&nbsp;</div><div>template &lt;class T&gt;</d=
iv><div>&nbsp;</div>

<div>struct true_predicate</div><div>{</div><div>&nbsp;&nbsp; bool operator=
 ()( const T &amp; ) const { return true; }</div><div>&nbsp;&nbsp; typedef =
T argument_type;</div><div>&nbsp;&nbsp; typedef bool result_type;</div><div=
>};</div><div>&nbsp;</div><div>

<div>template &lt;class T&gt;</div><div>&nbsp;</div><div>struct false_predi=
cate</div><div>{</div><div>&nbsp;&nbsp; bool operator ()( const T &amp; ) c=
onst { return false; }</div><div>&nbsp;&nbsp; typedef T argument_type;</div=
><div>&nbsp;&nbsp; typedef bool result_type;</div>

<div>};</div></div><div>&nbsp;</div><div>&nbsp;</div><div>If there is no su=
ch constructions in C++ Standard I would make a proposal.</div></div><span>=
<font color=3D"#888888">

<p></p>

-- <br>
&nbsp;<br>
--- <br>
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"=
szUkhVX_A0EJ">std-proposal...@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"javascript:" target=3D"_bla=
nk" gdf-obfuscated-mailto=3D"szUkhVX_A0EJ">std-pr...@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/<wbr>isocpp.or=
g/group/std-<wbr>proposals/</a>.<br>
</font></span></blockquote></div><br></div>
</blockquote></div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_89_13520779.1380796029666--

.


Author: Maurice Bos <m-ou.se@m-ou.se>
Date: Thu, 3 Oct 2013 12:33:38 +0200
Raw View
--e89a8f3bae5d3504d604e7d3b904
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

How about turning std::integral_constant::operator()() into operator()(...)
taking any number of arguments. Then using true_predicate =3D
std::integral_constant<bool, true>; would work, right?


2013/10/3 Vlad from Moscow <vlad.moscow@mail.ru>

> it would be not bad to use this idiom however how in the class
> specialization to define first_argument_type and second_argument_type?
>
>
> =DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 4:54:42 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Billy O'Neal
> =CE=C1=D0=C9=D3=C1=CC:
>
>> In keeping with the spirit of Stephan's Making Operator Functions
>> Greater<> proposal, I'd move the template parameter into the operator():
>>
>> template <class T =3D void>
>> struct true_predicate
>> {
>>    bool operator ()( const T & ) const { return true; }
>>    typedef T argument_type;
>>    typedef bool result_type;
>> };
>>
>> template <>
>> struct true_predicate<void>
>> {
>>    template <typename U>
>>    bool operator ()( const U & ) const { return true; }
>> };
>>
>> template <class T =3D void>
>> struct false_predicate
>> {
>>    bool operator ()( const T & ) const { return false; }
>>    typedef T argument_type;
>>    typedef bool result_type;
>> };
>>
>> template <>
>> struct false_predicate<void>
>> {
>>    template <typename U>
>>    bool operator ()( const U & ) const { return false; }
>> };
>>
>>
>> Billy O'Neal
>> https://github.com/BillyONeal/ <https://bitbucket.org/BillyONeal/>
>> http://stackoverflow.com/**users/82320/billy-oneal<http://stackoverflow.=
com/users/82320/billy-oneal>
>> Malware Response Instructor - BleepingComputer.com
>>
>>
>> On Wed, Oct 2, 2013 at 5:20 PM, Vlad from Moscow <vlad....@mail.ru>wrote=
:
>>
>>>  Is there in the Standard dummy default unary predicates something as
>>> true_predicate and false_predicate?
>>>
>>> For example
>>>
>>> template <class T>
>>>
>>> struct true_predicate
>>> {
>>>    bool operator ()( const T & ) const { return true; }
>>>    typedef T argument_type;
>>>    typedef bool result_type;
>>> };
>>>
>>> template <class T>
>>>
>>> struct false_predicate
>>> {
>>>    bool operator ()( const T & ) const { return false; }
>>>    typedef T argument_type;
>>>    typedef bool result_type;
>>> };
>>>
>>>
>>> If there is no such constructions in C++ Standard I would make a
>>> proposal.
>>>
>>> --
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "ISO C++ Standard - Future Proposals" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to std-proposal...@**isocpp.org.
>>> To post to this group, send email to std-pr...@isocpp.org.
>>>
>>> Visit this group at http://groups.google.com/a/**isocpp.org/group/std-*=
*
>>> proposals/ <http://groups.google.com/a/isocpp.org/group/std-proposals/>=
..
>>>
>>
>>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--e89a8f3bae5d3504d604e7d3b904
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">How about turning std::integral_constant::operator()() int=
o operator()(...) taking any number of arguments. Then using true_predicate=
 =3D std::integral_constant&lt;bool, true&gt;; would work, right?<br></div>=
<div class=3D"gmail_extra">

<br><br><div class=3D"gmail_quote">2013/10/3 Vlad from Moscow <span dir=3D"=
ltr">&lt;<a href=3D"mailto:vlad.moscow@mail.ru" target=3D"_blank">vlad.mosc=
ow@mail.ru</a>&gt;</span><br><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir=3D"ltr"><div>it would be not bad to use this idiom however how in =
the class specialization to define first_argument_type and second_argument_=
type?</div><div>=9A</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=
=D2=D1 2013=9A=C7., 4:54:42 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Bill=
y O&#39;Neal =CE=C1=D0=C9=D3=C1=CC:</div>

<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;padding=
-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-l=
eft-style:solid"><div class=3D"im"><div dir=3D"ltr">In keeping with the spi=
rit of Stephan&#39;s Making Operator Functions Greater&lt;&gt; proposal, I&=
#39;d move the template parameter into the operator():<div>

<br></div><div><div>template &lt;class T =3D void&gt;</div>

<div>struct true_predicate</div><div>{</div><div>=9A =9Abool operator ()( c=
onst T &amp; ) const { return true; }</div><div>=9A =9Atypedef T argument_t=
ype;</div><div>=9A =9Atypedef bool result_type;</div><div>};</div><div><br>=
</div><div>



template &lt;&gt;</div><div>struct true_predicate&lt;void&gt;</div><div>{</=
div><div>=9A =9Atemplate &lt;typename U&gt;</div><div>=9A =9Abool operator =
()( const U &amp; ) const { return true; }</div><div>};</div><div>=9A</div>=
<div>


template &lt;class T =3D void&gt;</div>
<div>struct false_predicate</div><div>{</div><div>=9A =9Abool operator ()( =
const T &amp; ) const { return false; }</div><div>=9A =9Atypedef T argument=
_type;</div><div>=9A =9Atypedef bool result_type;</div><div>};</div><div><b=
r></div>



<div>template &lt;&gt;</div><div>struct false_predicate&lt;void&gt;</div><d=
iv>{</div><div>=9A =9Atemplate &lt;typename U&gt;</div><div>=9A =9Abool ope=
rator ()( const U &amp; ) const { return false; }</div><div>};</div></div><=
div>



<br></div></div></div><div><div class=3D"im"><br clear=3D"all"><div><div di=
r=3D"ltr"><div>Billy O&#39;Neal</div><div><a href=3D"https://bitbucket.org/=
BillyONeal/" target=3D"_blank">https://github.com/BillyONeal/</a></div><div=
><a href=3D"http://stackoverflow.com/users/82320/billy-oneal" target=3D"_bl=
ank">http://stackoverflow.com/<u></u>users/82320/billy-oneal</a></div>



<div>Malware Response Instructor - BleepingComputer.com</div></div></div>
<br><br></div><div class=3D"gmail_quote"><div class=3D"im">On Wed, Oct 2, 2=
013 at 5:20 PM, Vlad from Moscow <span dir=3D"ltr">&lt;<a>vlad....@mail.ru<=
/a>&gt;</span> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"m=
argin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204)=
;border-left-width:1px;border-left-style:solid">

<div class=3D"im">

<div dir=3D"ltr"><div>Is there in the Standard dummy default unary predicat=
es=9Asomething as true_predicate and false_predicate?</div><div>=9A</div><d=
iv>For example</div><div>=9A</div><div>template &lt;class T&gt;</div><div>=
=9A</div>



<div>struct true_predicate</div><div>{</div><div>=9A=9A bool operator ()( c=
onst T &amp; ) const { return true; }</div><div>=9A=9A typedef T argument_t=
ype;</div><div>=9A=9A typedef bool result_type;</div><div>};</div><div>=9A<=
/div><div>



<div>template &lt;class T&gt;</div><div>=9A</div><div>struct false_predicat=
e</div><div>{</div><div>=9A=9A bool operator ()( const T &amp; ) const { re=
turn false; }</div><div>=9A=9A typedef T argument_type;</div><div>=9A=9A ty=
pedef bool result_type;</div>



<div>};</div></div><div>=9A</div><div>=9A</div><div>If there is no such con=
structions in C++ Standard I would make a proposal.</div></div></div><span>=
<font color=3D"#888888"><div class=3D"im">

<p></p>

-- <br>
=9A<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br></div>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a>std-proposal...@<u></u>isocpp.org</a>.<br>
To post to this group, send email to <a>std-pr...@isocpp.org</a>.<div class=
=3D"im"><br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/<u></u>isocpp.=
org/group/std-<u></u>proposals/</a>.<br>
</div></font></span></blockquote></div><br></div>
</blockquote></div><div class=3D"HOEnZb"><div class=3D"h5">

<p></p>

-- <br>
=9A<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals%2Bunsubscribe@isocpp.org" target=3D=
"_blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</div></div></blockquote></div><br></div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--e89a8f3bae5d3504d604e7d3b904--

.


Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Thu, 3 Oct 2013 03:45:14 -0700 (PDT)
Raw View
------=_Part_4599_11724387.1380797114220
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

I think that it would be even better to define std:: plus the following way
=20
template <class ...T> struct plus;
template <class T> struct plus<T>=20
{
 typedef T    first_argument_type;
 typedef T    second_argument_type;
 typedef T result_type;
 constexpr bool operator ()( const T &x, const T &y ) const=20
 {=20
  return ( x + y );=20
 }
=20
};
template <class T, class U> struct plus<T, U>=20
{
 typedef T    first_argument_type;
 typedef U    second_argument_type;
 typedef typename std::common_type<T, U>::value result_type;
 constexpr typename std::common_type<T, U>::value operator ()( const T &x,=
=20
const U &y ) const=20
 {=20
  return ( x + y );=20
 }
};
instead of the definition in the standard.
=20

=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 14:01:07 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
=CE=C1=D0=C9=D3=C1=CC:

> If this code is valid then false_predicate (and correspondingly=20
> true_predicate) could be defined the following way. At least this code is=
=20
> compiled with GCC
> =20
> template <class ...T> struct false_predicate;
> template <class T> struct false_predicate<T>=20
> {
>  typedef T    argument_type;
>  typedef bool result_type;
>  constexpr bool operator ()( const T & ) const=20
>  {=20
>   return ( false );=20
>  }
> =20
> };
> template <class T, class U> struct false_predicate<T, U>=20
> {
>  typedef T    first_argument_type;
>  typedef U    second_argument_type;
>  typedef bool result_type;
>  constexpr bool operator ()( const T &, const U & ) const=20
>  {=20
>   return ( false );=20
>  }
> };
> =20
>
> =DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 6:12:47 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
> =CE=C1=D0=C9=D3=C1=CC:
>
>> =20
>> Maybe something as
>> =20
>> template <class T>
>> struct false_predicate
>> {
>>  constexpr bool operator ()( const T &... ) const { return ( false ); }
>>  typedef T    argument_type;
>>  typedef bool result_type;
>> };
>>
>> =DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 4:20:17 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
>> =CE=C1=D0=C9=D3=C1=CC:
>>
>>> Is there in the Standard dummy default unary predicates something as=20
>>> true_predicate and false_predicate?
>>> =20
>>> For example
>>> =20
>>> template <class T>
>>> =20
>>> struct true_predicate
>>> {
>>>    bool operator ()( const T & ) const { return true; }
>>>    typedef T argument_type;
>>>    typedef bool result_type;
>>> };
>>> =20
>>> template <class T>
>>> =20
>>> struct false_predicate
>>> {
>>>    bool operator ()( const T & ) const { return false; }
>>>    typedef T argument_type;
>>>    typedef bool result_type;
>>> };
>>> =20
>>> =20
>>> If there is no such constructions in C++ Standard I would make a=20
>>> proposal.
>>>
>>

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_4599_11724387.1380797114220
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>I think that it would be even better to define std:: =
plus the following way</div><div>&nbsp;</div><div>template &lt;class ...T&g=
t; struct plus;</div><div>template &lt;class T&gt; struct plus&lt;T&gt; <br=
>{<br>&nbsp;typedef T&nbsp;&nbsp;&nbsp; first_argument_type;<br>&nbsp;typed=
ef T&nbsp;&nbsp;&nbsp; second_argument_type;<br>&nbsp;typedef T result_type=
;<br>&nbsp;constexpr bool operator ()( const T &amp;x, const T &amp;y ) con=
st <br>&nbsp;{ <br>&nbsp;&nbsp;return ( x + y ); <br>&nbsp;}<br>&nbsp;<br>}=
;</div><div>template &lt;class T, class U&gt; struct plus&lt;T, U&gt; <br>{=
<br>&nbsp;typedef T&nbsp;&nbsp;&nbsp; first_argument_type;<br>&nbsp;typedef=
 U&nbsp;&nbsp;&nbsp; second_argument_type;<br>&nbsp;typedef typename std::c=
ommon_type&lt;T, U&gt;::value result_type;<br>&nbsp;constexpr typename std:=
:common_type&lt;T, U&gt;::value operator ()( const T &amp;x, const U &amp;y=
 ) const <br>&nbsp;{ <br>&nbsp;&nbsp;return ( x + y ); <br>&nbsp;}<br>};<br=
></div><div>instead of the definition in the standard.</div><div>&nbsp;</di=
v><div><br>=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013&nbsp;=C7., 1=
4:01:07 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow =CE=C1=
=D0=C9=D3=C1=CC:</div><blockquote class=3D"gmail_quote" style=3D"margin: 0p=
x 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); =
border-left-width: 1px; border-left-style: solid;"><div dir=3D"ltr"><div>If=
 this code is valid then false_predicate (and correspondingly true_predicat=
e) could be defined the following way. At least this code is compiled with =
GCC</div><div>&nbsp;</div><div>template &lt;class ...T&gt; struct false_pre=
dicate;<br>template &lt;class T&gt; struct false_predicate&lt;T&gt; <br>{<b=
r>&nbsp;typedef T&nbsp;&nbsp;&nbsp; argument_type;<br>&nbsp;typedef bool re=
sult_type;<br>&nbsp;constexpr bool operator ()( const T &amp; ) const <br>&=
nbsp;{ <br>&nbsp;&nbsp;return ( false ); <br>&nbsp;}<br>&nbsp;<br>};<br>tem=
plate &lt;class T, class U&gt; struct false_predicate&lt;T, U&gt; <br>{<br>=
&nbsp;typedef T&nbsp;&nbsp;&nbsp; first_argument_type;<br>&nbsp;typedef U&n=
bsp;&nbsp;&nbsp; second_argument_type;<br>&nbsp;typedef bool result_type;<b=
r>&nbsp;constexpr bool operator ()( const T &amp;, const U &amp; ) const <b=
r>&nbsp;{ <br>&nbsp;&nbsp;return ( false ); <br>&nbsp;}<br>};</div><div>&nb=
sp;</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013&nbsp;=
=C7., 6:12:47 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow =
=CE=C1=D0=C9=D3=C1=CC:</div><blockquote class=3D"gmail_quote" style=3D"marg=
in: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, =
204); border-left-width: 1px; border-left-style: solid;"><div dir=3D"ltr"><=
div>&nbsp;</div><div>Maybe something as</div><div>&nbsp;</div><div>template=
 &lt;class T&gt;<br>struct false_predicate<br>{<br>&nbsp;constexpr bool ope=
rator ()( const T &amp;... ) const { return ( false ); }<br>&nbsp;typedef T=
&nbsp;&nbsp;&nbsp; argument_type;<br>&nbsp;typedef bool result_type;<br>};<=
/div><div><br>=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013&nbsp;=C7.=
, 4:20:17 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow =CE=
=C1=D0=C9=D3=C1=CC:</div><blockquote class=3D"gmail_quote" style=3D"margin:=
 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204=
); border-left-width: 1px; border-left-style: solid;"><div dir=3D"ltr"><div=
>Is there in the Standard dummy default unary predicates&nbsp;something as =
true_predicate and false_predicate?</div><div>&nbsp;</div><div>For example<=
/div><div>&nbsp;</div><div>template &lt;class T&gt;</div><div>&nbsp;</div><=
div>struct true_predicate</div><div>{</div><div>&nbsp;&nbsp; bool operator =
()( const T &amp; ) const { return true; }</div><div>&nbsp;&nbsp; typedef T=
 argument_type;</div><div>&nbsp;&nbsp; typedef bool result_type;</div><div>=
};</div><div>&nbsp;</div><div><div>template &lt;class T&gt;</div><div>&nbsp=
;</div><div>struct false_predicate</div><div>{</div><div>&nbsp;&nbsp; bool =
operator ()( const T &amp; ) const { return false; }</div><div>&nbsp;&nbsp;=
 typedef T argument_type;</div><div>&nbsp;&nbsp; typedef bool result_type;<=
/div><div>};</div></div><div>&nbsp;</div><div>&nbsp;</div><div>If there is =
no such constructions in C++ Standard I would make a proposal.</div></div><=
/blockquote></div></blockquote></div></blockquote></div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_4599_11724387.1380797114220--

.


Author: "=?utf-8?B?YmlsbHkub25lYWxAZ21haWwuY29t?=" <billy.oneal@gmail.com>
Date: Thu, 03 Oct 2013 07:17:06 -0700
Raw View
------=_Part_0_1380809826118
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

There's only one argument, so those should not be defined. They were deprec=
ated in C++11 anyway.

Sent from a touchscreen. Please excuse the brevity and tpyos.

----- Reply message -----
From: "Vlad from Moscow" <vlad.moscow@mail.ru>
To: <std-proposals@isocpp.org>
Subject: [std-proposals] true_predicate and false_predicate
Date: Thu, Oct 3, 2013 3:27 AM

it would be not bad to use this idiom however how in the class specializati=
on to define first_argument_type and second_argument_type?


=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 4:54:42 UTC+4 =D0=
=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Billy O'Neal =CE=C1=D0=C9=D3=C1=CC:
In keeping with the spirit of Stephan's Making Operator Functions Greater<>=
 proposal, I'd move the template parameter into the operator():
template <class T =3D void>


struct true_predicate
{
bool operator ()( const T & ) const { return true; }
typedef T argument_type;
typedef bool result_type;
};



template <>
struct true_predicate<void>
{
template <typename U>
bool operator ()( const U & ) const { return true; }
};


template <class T =3D void>

struct false_predicate
{
bool operator ()( const T & ) const { return false; }
typedef T argument_type;
typedef bool result_type;
};



template <>
struct false_predicate<void>
{
template <typename U>
bool operator ()( const U & ) const { return false; }
};




Billy O'Neal
https://github.com/BillyONeal/
http://stackoverflow.com/users/82320/billy-oneal


Malware Response Instructor - BleepingComputer.com




On Wed, Oct 2, 2013 at 5:20 PM, Vlad from Moscow <vlad....@mail.ru> wrote:


Is there in the Standard dummy default unary predicates something as true_p=
redicate and false_predicate?

For example

template <class T>



struct true_predicate
{
bool operator ()( const T & ) const { return true; }
typedef T argument_type;
typedef bool result_type;
};



template <class T>

struct false_predicate
{
bool operator ()( const T & ) const { return false; }
typedef T argument_type;
typedef bool result_type;


};


If there is no such constructions in C++ Standard I would make a proposal.




--=20



---=20

You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.

To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposal...@isocpp.org.

To post to this group, send email to std-pr...@isocpp.org.

Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.









--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_0_1380809826118
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

<div style=3D"font-size: 12pt; font-family: Calibri,sans-serif;"><div>There=
's only one argument, so those should not be defined. They were deprecated =
in C++11 anyway.</div><div><br></div><div>Sent from a touchscreen. Please e=
xcuse the brevity and tpyos.</div><br><div id=3D"htc_header">----- Reply me=
ssage -----<br>From: &quot;Vlad from Moscow&quot; &lt;vlad.moscow@mail.ru&g=
t;<br>To: &lt;std-proposals@isocpp.org&gt;<br>Subject: [std-proposals] true=
_predicate and false_predicate<br>Date: Thu, Oct 3, 2013 3:27 AM</div></div=
><br><div dir=3D"ltr"><div>it would be not bad to use this idiom however ho=
w in the class specialization to define first_argument_type and second_argu=
ment_type?</div><div>&nbsp;</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=
=D4=D1=C2=D2=D1 2013&nbsp;=C7., 4:54:42 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=
=C5=CC=D8 Billy O'Neal =CE=C1=D0=C9=D3=C1=CC:</div><blockquote class=3D"gma=
il_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-lef=
t-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: sol=
id;"><div dir=3D"ltr">In keeping with the spirit of Stephan's Making Operat=
or Functions Greater&lt;&gt; proposal, I'd move the template parameter into=
 the operator():<div><br></div><div><div>template &lt;class T =3D void&gt;<=
/div>

<div>struct true_predicate</div><div>{</div><div>&nbsp; &nbsp;bool operator=
 ()( const T &amp; ) const { return true; }</div><div>&nbsp; &nbsp;typedef =
T argument_type;</div><div>&nbsp; &nbsp;typedef bool result_type;</div><div=
>};</div><div><br></div><div>

template &lt;&gt;</div><div>struct true_predicate&lt;void&gt;</div><div>{</=
div><div>&nbsp; &nbsp;template &lt;typename U&gt;</div><div>&nbsp; &nbsp;bo=
ol operator ()( const U &amp; ) const { return true; }</div><div>};</div><d=
iv>&nbsp;</div><div>
template &lt;class T =3D void&gt;</div>
<div>struct false_predicate</div><div>{</div><div>&nbsp; &nbsp;bool operato=
r ()( const T &amp; ) const { return false; }</div><div>&nbsp; &nbsp;typede=
f T argument_type;</div><div>&nbsp; &nbsp;typedef bool result_type;</div><d=
iv>};</div><div><br></div>

<div>template &lt;&gt;</div><div>struct false_predicate&lt;void&gt;</div><d=
iv>{</div><div>&nbsp; &nbsp;template &lt;typename U&gt;</div><div>&nbsp; &n=
bsp;bool operator ()( const U &amp; ) const { return false; }</div><div>};<=
/div></div><div>

<br></div></div><div><br clear=3D"all"><div><div dir=3D"ltr"><div>Billy O'N=
eal</div><div><a href=3D"https://bitbucket.org/BillyONeal/" target=3D"_blan=
k">https://github.com/BillyONeal/</a></div><div><a href=3D"http://stackover=
flow.com/users/82320/billy-oneal" target=3D"_blank">http://stackoverflow.co=
m/<wbr>users/82320/billy-oneal</a></div>

<div>Malware Response Instructor - BleepingComputer.com</div></div></div>
<br><br><div class=3D"gmail_quote">On Wed, Oct 2, 2013 at 5:20 PM, Vlad fro=
m Moscow <span dir=3D"ltr">&lt;<a href=3D"javascript:" target=3D"_blank" gd=
f-obfuscated-mailto=3D"szUkhVX_A0EJ">vlad....@mail.ru</a>&gt;</span> wrote:=
<br><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; p=
adding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width:=
 1px; border-left-style: solid;">

<div dir=3D"ltr"><div>Is there in the Standard dummy default unary predicat=
es&nbsp;something as true_predicate and false_predicate?</div><div>&nbsp;</=
div><div>For example</div><div>&nbsp;</div><div>template &lt;class T&gt;</d=
iv><div>&nbsp;</div>

<div>struct true_predicate</div><div>{</div><div>&nbsp;&nbsp; bool operator=
 ()( const T &amp; ) const { return true; }</div><div>&nbsp;&nbsp; typedef =
T argument_type;</div><div>&nbsp;&nbsp; typedef bool result_type;</div><div=
>};</div><div>&nbsp;</div><div>

<div>template &lt;class T&gt;</div><div>&nbsp;</div><div>struct false_predi=
cate</div><div>{</div><div>&nbsp;&nbsp; bool operator ()( const T &amp; ) c=
onst { return false; }</div><div>&nbsp;&nbsp; typedef T argument_type;</div=
><div>&nbsp;&nbsp; typedef bool result_type;</div>

<div>};</div></div><div>&nbsp;</div><div>&nbsp;</div><div>If there is no su=
ch constructions in C++ Standard I would make a proposal.</div></div><span>=
<font color=3D"#888888">

<p></p>

-- <br>
&nbsp;<br>
--- <br>
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"=
szUkhVX_A0EJ">std-proposal...@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"javascript:" target=3D"_bla=
nk" gdf-obfuscated-mailto=3D"szUkhVX_A0EJ">std-pr...@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/<wbr>isocpp.or=
g/group/std-<wbr>proposals/</a>.<br>
</font></span></blockquote></div><br></div>
</blockquote></div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_0_1380809826118--


.


Author: "=?utf-8?B?YmlsbHkub25lYWxAZ21haWwuY29t?=" <billy.oneal@gmail.com>
Date: Thu, 03 Oct 2013 07:23:11 -0700
Raw View
------=_Part_0_1380810191896
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Why? Plus it's a binary operator; it doesn't make sense as anything other t=
han a binary function.

Sent from a touchscreen. Please excuse the brevity and tpyos.

----- Reply message -----
From: "Vlad from Moscow" <vlad.moscow@mail.ru>
To: <std-proposals@isocpp.org>
Subject: [std-proposals] Re: true_predicate and false_predicate
Date: Thu, Oct 3, 2013 3:45 AM

I think that it would be even better to define std:: plus the following way

template <class ...T> struct plus;
template <class T> struct plus<T>=20
{
typedef T    first_argument_type;
typedef T    second_argument_type;
typedef T result_type;
constexpr bool operator ()( const T &x, const T &y ) const=20
{=20
return ( x + y );=20
}

};
template <class T, class U> struct plus<T, U>=20
{
typedef T    first_argument_type;
typedef U    second_argument_type;
typedef typename std::common_type<T, U>::value result_type;
constexpr typename std::common_type<T, U>::value operator ()( const T &x, c=
onst U &y ) const=20
{=20
return ( x + y );=20
}
};
instead of the definition in the standard.


=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 14:01:07 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow =CE=C1=D0=C9=D3=C1=CC=
:
If this code is valid then false_predicate (and correspondingly true_predic=
ate) could be defined the following way. At least this code is compiled wit=
h GCC

template <class ...T> struct false_predicate;
template <class T> struct false_predicate<T>=20
{
typedef T    argument_type;
typedef bool result_type;
constexpr bool operator ()( const T & ) const=20
{=20
return ( false );=20
}

};
template <class T, class U> struct false_predicate<T, U>=20
{
typedef T    first_argument_type;
typedef U    second_argument_type;
typedef bool result_type;
constexpr bool operator ()( const T &, const U & ) const=20
{=20
return ( false );=20
}
};


=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 6:12:47 UTC+4 =D0=
=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow =CE=C1=D0=C9=D3=C1=CC:

Maybe something as

template <class T>
struct false_predicate
{
constexpr bool operator ()( const T &... ) const { return ( false ); }
typedef T    argument_type;
typedef bool result_type;
};

=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 4:20:17 UTC+4 =D0=
=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow =CE=C1=D0=C9=D3=C1=CC:
Is there in the Standard dummy default unary predicates something as true_p=
redicate and false_predicate?

For example

template <class T>

struct true_predicate
{
bool operator ()( const T & ) const { return true; }
typedef T argument_type;
typedef bool result_type;
};

template <class T>

struct false_predicate
{
bool operator ()( const T & ) const { return false; }
typedef T argument_type;
typedef bool result_type;
};


If there is no such constructions in C++ Standard I would make a proposal.







--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_0_1380810191896
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

<div style=3D"font-size: 12pt; font-family: Calibri,sans-serif;"><div>Why? =
Plus it's a binary operator; it doesn't make sense as anything other than a=
 binary function.</div><div><br></div><div>Sent from a touchscreen. Please =
excuse the brevity and tpyos.</div><br><div id=3D"htc_header">----- Reply m=
essage -----<br>From: &quot;Vlad from Moscow&quot; &lt;vlad.moscow@mail.ru&=
gt;<br>To: &lt;std-proposals@isocpp.org&gt;<br>Subject: [std-proposals] Re:=
 true_predicate and false_predicate<br>Date: Thu, Oct 3, 2013 3:45 AM</div>=
</div><br><div dir=3D"ltr"><div>I think that it would be even better to def=
ine std:: plus the following way</div><div>&nbsp;</div><div>template &lt;cl=
ass ...T&gt; struct plus;</div><div>template &lt;class T&gt; struct plus&lt=
;T&gt; <br>{<br>&nbsp;typedef T&nbsp;&nbsp;&nbsp; first_argument_type;<br>&=
nbsp;typedef T&nbsp;&nbsp;&nbsp; second_argument_type;<br>&nbsp;typedef T r=
esult_type;<br>&nbsp;constexpr bool operator ()( const T &amp;x, const T &a=
mp;y ) const <br>&nbsp;{ <br>&nbsp;&nbsp;return ( x + y ); <br>&nbsp;}<br>&=
nbsp;<br>};</div><div>template &lt;class T, class U&gt; struct plus&lt;T, U=
&gt; <br>{<br>&nbsp;typedef T&nbsp;&nbsp;&nbsp; first_argument_type;<br>&nb=
sp;typedef U&nbsp;&nbsp;&nbsp; second_argument_type;<br>&nbsp;typedef typen=
ame std::common_type&lt;T, U&gt;::value result_type;<br>&nbsp;constexpr typ=
ename std::common_type&lt;T, U&gt;::value operator ()( const T &amp;x, cons=
t U &amp;y ) const <br>&nbsp;{ <br>&nbsp;&nbsp;return ( x + y ); <br>&nbsp;=
}<br>};<br></div><div>instead of the definition in the standard.</div><div>=
&nbsp;</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013&nb=
sp;=C7., 14:01:07 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Mosc=
ow =CE=C1=D0=C9=D3=C1=CC:</div><blockquote class=3D"gmail_quote" style=3D"m=
argin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 20=
4, 204); border-left-width: 1px; border-left-style: solid;"><div dir=3D"ltr=
"><div>If this code is valid then false_predicate (and correspondingly true=
_predicate) could be defined the following way. At least this code is compi=
led with GCC</div><div>&nbsp;</div><div>template &lt;class ...T&gt; struct =
false_predicate;<br>template &lt;class T&gt; struct false_predicate&lt;T&gt=
; <br>{<br>&nbsp;typedef T&nbsp;&nbsp;&nbsp; argument_type;<br>&nbsp;typede=
f bool result_type;<br>&nbsp;constexpr bool operator ()( const T &amp; ) co=
nst <br>&nbsp;{ <br>&nbsp;&nbsp;return ( false ); <br>&nbsp;}<br>&nbsp;<br>=
};<br>template &lt;class T, class U&gt; struct false_predicate&lt;T, U&gt; =
<br>{<br>&nbsp;typedef T&nbsp;&nbsp;&nbsp; first_argument_type;<br>&nbsp;ty=
pedef U&nbsp;&nbsp;&nbsp; second_argument_type;<br>&nbsp;typedef bool resul=
t_type;<br>&nbsp;constexpr bool operator ()( const T &amp;, const U &amp; )=
 const <br>&nbsp;{ <br>&nbsp;&nbsp;return ( false ); <br>&nbsp;}<br>};</div=
><div>&nbsp;</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2=
013&nbsp;=C7., 6:12:47 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from=
 Moscow =CE=C1=D0=C9=D3=C1=CC:</div><blockquote class=3D"gmail_quote" style=
=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(20=
4, 204, 204); border-left-width: 1px; border-left-style: solid;"><div dir=
=3D"ltr"><div>&nbsp;</div><div>Maybe something as</div><div>&nbsp;</div><di=
v>template &lt;class T&gt;<br>struct false_predicate<br>{<br>&nbsp;constexp=
r bool operator ()( const T &amp;... ) const { return ( false ); }<br>&nbsp=
;typedef T&nbsp;&nbsp;&nbsp; argument_type;<br>&nbsp;typedef bool result_ty=
pe;<br>};</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013=
&nbsp;=C7., 4:20:17 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Mo=
scow =CE=C1=D0=C9=D3=C1=CC:</div><blockquote class=3D"gmail_quote" style=3D=
"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, =
204, 204); border-left-width: 1px; border-left-style: solid;"><div dir=3D"l=
tr"><div>Is there in the Standard dummy default unary predicates&nbsp;somet=
hing as true_predicate and false_predicate?</div><div>&nbsp;</div><div>For =
example</div><div>&nbsp;</div><div>template &lt;class T&gt;</div><div>&nbsp=
;</div><div>struct true_predicate</div><div>{</div><div>&nbsp;&nbsp; bool o=
perator ()( const T &amp; ) const { return true; }</div><div>&nbsp;&nbsp; t=
ypedef T argument_type;</div><div>&nbsp;&nbsp; typedef bool result_type;</d=
iv><div>};</div><div>&nbsp;</div><div><div>template &lt;class T&gt;</div><d=
iv>&nbsp;</div><div>struct false_predicate</div><div>{</div><div>&nbsp;&nbs=
p; bool operator ()( const T &amp; ) const { return false; }</div><div>&nbs=
p;&nbsp; typedef T argument_type;</div><div>&nbsp;&nbsp; typedef bool resul=
t_type;</div><div>};</div></div><div>&nbsp;</div><div>&nbsp;</div><div>If t=
here is no such constructions in C++ Standard I would make a proposal.</div=
></div></blockquote></div></blockquote></div></blockquote></div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_0_1380810191896--


.


Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Thu, 3 Oct 2013 08:43:16 -0700 (PDT)
Raw View
------=_Part_403_17099095.1380814996168
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

As a said effect for example true_predicate could be used in std::copy_if=
=20
algorithm when there is a general function that uses std::copy_if and you=
=20
need to use it that to copy all elements of a container.:)
=20

=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 14:45:14 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
=CE=C1=D0=C9=D3=C1=CC:

> I think that it would be even better to define std:: plus the following w=
ay
> =20
> template <class ...T> struct plus;
> template <class T> struct plus<T>=20
> {
>  typedef T    first_argument_type;
>  typedef T    second_argument_type;
>  typedef T result_type;
>  constexpr bool operator ()( const T &x, const T &y ) const=20
>  {=20
>   return ( x + y );=20
>  }
> =20
> };
> template <class T, class U> struct plus<T, U>=20
> {
>  typedef T    first_argument_type;
>  typedef U    second_argument_type;
>  typedef typename std::common_type<T, U>::value result_type;
>  constexpr typename std::common_type<T, U>::value operator ()( const T &x=
,=20
> const U &y ) const=20
>  {=20
>   return ( x + y );=20
>  }
> };
> instead of the definition in the standard.
> =20
>
> =DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 14:01:07 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
> =CE=C1=D0=C9=D3=C1=CC:
>
>> If this code is valid then false_predicate (and correspondingly=20
>> true_predicate) could be defined the following way. At least this code i=
s=20
>> compiled with GCC
>> =20
>> template <class ...T> struct false_predicate;
>> template <class T> struct false_predicate<T>=20
>> {
>>  typedef T    argument_type;
>>  typedef bool result_type;
>>  constexpr bool operator ()( const T & ) const=20
>>  {=20
>>   return ( false );=20
>>  }
>> =20
>> };
>> template <class T, class U> struct false_predicate<T, U>=20
>> {
>>  typedef T    first_argument_type;
>>  typedef U    second_argument_type;
>>  typedef bool result_type;
>>  constexpr bool operator ()( const T &, const U & ) const=20
>>  {=20
>>   return ( false );=20
>>  }
>> };
>> =20
>>
>> =DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 6:12:47 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
>> =CE=C1=D0=C9=D3=C1=CC:
>>
>>> =20
>>> Maybe something as
>>> =20
>>> template <class T>
>>> struct false_predicate
>>> {
>>>  constexpr bool operator ()( const T &... ) const { return ( false ); }
>>>  typedef T    argument_type;
>>>  typedef bool result_type;
>>> };
>>>
>>> =DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 4:20:17 UTC+4=
 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
>>> =CE=C1=D0=C9=D3=C1=CC:
>>>
>>>> Is there in the Standard dummy default unary predicates something as=
=20
>>>> true_predicate and false_predicate?
>>>> =20
>>>> For example
>>>> =20
>>>> template <class T>
>>>> =20
>>>> struct true_predicate
>>>> {
>>>>    bool operator ()( const T & ) const { return true; }
>>>>    typedef T argument_type;
>>>>    typedef bool result_type;
>>>> };
>>>> =20
>>>> template <class T>
>>>> =20
>>>> struct false_predicate
>>>> {
>>>>    bool operator ()( const T & ) const { return false; }
>>>>    typedef T argument_type;
>>>>    typedef bool result_type;
>>>> };
>>>> =20
>>>> =20
>>>> If there is no such constructions in C++ Standard I would make a=20
>>>> proposal.
>>>>
>>>

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_403_17099095.1380814996168
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>As a said effect for example true_predicate could be =
used in std::copy_if algorithm when&nbsp;there is a general function that u=
ses std::copy_if and you need to use it that to copy all elements of a cont=
ainer.:)</div><div>&nbsp;</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=
=D1=C2=D2=D1 2013&nbsp;=C7., 14:45:14 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=
=CC=D8 Vlad from Moscow =CE=C1=D0=C9=D3=C1=CC:</div><blockquote class=3D"gm=
ail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-le=
ft-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: so=
lid;"><div dir=3D"ltr"><div>I think that it would be even better to define =
std:: plus the following way</div><div>&nbsp;</div><div>template &lt;class =
....T&gt; struct plus;</div><div>template &lt;class T&gt; struct plus&lt;T&g=
t; <br>{<br>&nbsp;typedef T&nbsp;&nbsp;&nbsp; first_argument_type;<br>&nbsp=
;typedef T&nbsp;&nbsp;&nbsp; second_argument_type;<br>&nbsp;typedef T resul=
t_type;<br>&nbsp;constexpr bool operator ()( const T &amp;x, const T &amp;y=
 ) const <br>&nbsp;{ <br>&nbsp;&nbsp;return ( x + y ); <br>&nbsp;}<br>&nbsp=
;<br>};</div><div>template &lt;class T, class U&gt; struct plus&lt;T, U&gt;=
 <br>{<br>&nbsp;typedef T&nbsp;&nbsp;&nbsp; first_argument_type;<br>&nbsp;t=
ypedef U&nbsp;&nbsp;&nbsp; second_argument_type;<br>&nbsp;typedef typename =
std::common_type&lt;T, U&gt;::value result_type;<br>&nbsp;constexpr typenam=
e std::common_type&lt;T, U&gt;::value operator ()( const T &amp;x, const U =
&amp;y ) const <br>&nbsp;{ <br>&nbsp;&nbsp;return ( x + y ); <br>&nbsp;}<br=
>};<br></div><div>instead of the definition in the standard.</div><div>&nbs=
p;</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013&nbsp;=
=C7., 14:01:07 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow =
=CE=C1=D0=C9=D3=C1=CC:</div><blockquote class=3D"gmail_quote" style=3D"marg=
in: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, =
204); border-left-width: 1px; border-left-style: solid;"><div dir=3D"ltr"><=
div>If this code is valid then false_predicate (and correspondingly true_pr=
edicate) could be defined the following way. At least this code is compiled=
 with GCC</div><div>&nbsp;</div><div>template &lt;class ...T&gt; struct fal=
se_predicate;<br>template &lt;class T&gt; struct false_predicate&lt;T&gt; <=
br>{<br>&nbsp;typedef T&nbsp;&nbsp;&nbsp; argument_type;<br>&nbsp;typedef b=
ool result_type;<br>&nbsp;constexpr bool operator ()( const T &amp; ) const=
 <br>&nbsp;{ <br>&nbsp;&nbsp;return ( false ); <br>&nbsp;}<br>&nbsp;<br>};<=
br>template &lt;class T, class U&gt; struct false_predicate&lt;T, U&gt; <br=
>{<br>&nbsp;typedef T&nbsp;&nbsp;&nbsp; first_argument_type;<br>&nbsp;typed=
ef U&nbsp;&nbsp;&nbsp; second_argument_type;<br>&nbsp;typedef bool result_t=
ype;<br>&nbsp;constexpr bool operator ()( const T &amp;, const U &amp; ) co=
nst <br>&nbsp;{ <br>&nbsp;&nbsp;return ( false ); <br>&nbsp;}<br>};</div><d=
iv>&nbsp;</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013=
&nbsp;=C7., 6:12:47 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Mo=
scow =CE=C1=D0=C9=D3=C1=CC:</div><blockquote class=3D"gmail_quote" style=3D=
"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, =
204, 204); border-left-width: 1px; border-left-style: solid;"><div dir=3D"l=
tr"><div>&nbsp;</div><div>Maybe something as</div><div>&nbsp;</div><div>tem=
plate &lt;class T&gt;<br>struct false_predicate<br>{<br>&nbsp;constexpr boo=
l operator ()( const T &amp;... ) const { return ( false ); }<br>&nbsp;type=
def T&nbsp;&nbsp;&nbsp; argument_type;<br>&nbsp;typedef bool result_type;<b=
r>};</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013&nbsp=
;=C7., 4:20:17 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow =
=CE=C1=D0=C9=D3=C1=CC:</div><blockquote class=3D"gmail_quote" style=3D"marg=
in: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, =
204); border-left-width: 1px; border-left-style: solid;"><div dir=3D"ltr"><=
div>Is there in the Standard dummy default unary predicates&nbsp;something =
as true_predicate and false_predicate?</div><div>&nbsp;</div><div>For examp=
le</div><div>&nbsp;</div><div>template &lt;class T&gt;</div><div>&nbsp;</di=
v><div>struct true_predicate</div><div>{</div><div>&nbsp;&nbsp; bool operat=
or ()( const T &amp; ) const { return true; }</div><div>&nbsp;&nbsp; typede=
f T argument_type;</div><div>&nbsp;&nbsp; typedef bool result_type;</div><d=
iv>};</div><div>&nbsp;</div><div><div>template &lt;class T&gt;</div><div>&n=
bsp;</div><div>struct false_predicate</div><div>{</div><div>&nbsp;&nbsp; bo=
ol operator ()( const T &amp; ) const { return false; }</div><div>&nbsp;&nb=
sp; typedef T argument_type;</div><div>&nbsp;&nbsp; typedef bool result_typ=
e;</div><div>};</div></div><div>&nbsp;</div><div>&nbsp;</div><div>If there =
is no such constructions in C++ Standard I would make a proposal.</div></di=
v></blockquote></div></blockquote></div></blockquote></div></blockquote></d=
iv>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_403_17099095.1380814996168--

.


Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Thu, 3 Oct 2013 08:45:55 -0700 (PDT)
Raw View
------=_Part_429_1255765.1380815155112
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

Sorry, I meant a side effect. :)
=20

=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 19:43:16 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
=CE=C1=D0=C9=D3=C1=CC:

> As a said effect for example true_predicate could be used in std::copy_if=
=20
> algorithm when there is a general function that uses std::copy_if and you=
=20
> need to use it that to copy all elements of a container.:)
> =20
>
> =DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 14:45:14 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
> =CE=C1=D0=C9=D3=C1=CC:
>
>> I think that it would be even better to define std:: plus the following=
=20
>> way
>> =20
>> template <class ...T> struct plus;
>> template <class T> struct plus<T>=20
>> {
>>  typedef T    first_argument_type;
>>  typedef T    second_argument_type;
>>  typedef T result_type;
>>  constexpr bool operator ()( const T &x, const T &y ) const=20
>>  {=20
>>   return ( x + y );=20
>>  }
>> =20
>> };
>> template <class T, class U> struct plus<T, U>=20
>> {
>>  typedef T    first_argument_type;
>>  typedef U    second_argument_type;
>>  typedef typename std::common_type<T, U>::value result_type;
>>  constexpr typename std::common_type<T, U>::value operator ()( const T=
=20
>> &x, const U &y ) const=20
>>  {=20
>>   return ( x + y );=20
>>  }
>> };
>> instead of the definition in the standard.
>> =20
>>
>> =DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 14:01:07 UTC+4=
 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
>> =CE=C1=D0=C9=D3=C1=CC:
>>
>>> If this code is valid then false_predicate (and correspondingly=20
>>> true_predicate) could be defined the following way. At least this code =
is=20
>>> compiled with GCC
>>> =20
>>> template <class ...T> struct false_predicate;
>>> template <class T> struct false_predicate<T>=20
>>> {
>>>  typedef T    argument_type;
>>>  typedef bool result_type;
>>>  constexpr bool operator ()( const T & ) const=20
>>>  {=20
>>>   return ( false );=20
>>>  }
>>> =20
>>> };
>>> template <class T, class U> struct false_predicate<T, U>=20
>>> {
>>>  typedef T    first_argument_type;
>>>  typedef U    second_argument_type;
>>>  typedef bool result_type;
>>>  constexpr bool operator ()( const T &, const U & ) const=20
>>>  {=20
>>>   return ( false );=20
>>>  }
>>> };
>>> =20
>>>
>>> =DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 6:12:47 UTC+4=
 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
>>> =CE=C1=D0=C9=D3=C1=CC:
>>>
>>>> =20
>>>> Maybe something as
>>>> =20
>>>> template <class T>
>>>> struct false_predicate
>>>> {
>>>>  constexpr bool operator ()( const T &... ) const { return ( false ); =
}
>>>>  typedef T    argument_type;
>>>>  typedef bool result_type;
>>>> };
>>>>
>>>> =DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 4:20:17 UTC+=
4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow=20
>>>> =CE=C1=D0=C9=D3=C1=CC:
>>>>
>>>>> Is there in the Standard dummy default unary predicates something as=
=20
>>>>> true_predicate and false_predicate?
>>>>> =20
>>>>> For example
>>>>> =20
>>>>> template <class T>
>>>>> =20
>>>>> struct true_predicate
>>>>> {
>>>>>    bool operator ()( const T & ) const { return true; }
>>>>>    typedef T argument_type;
>>>>>    typedef bool result_type;
>>>>> };
>>>>> =20
>>>>> template <class T>
>>>>> =20
>>>>> struct false_predicate
>>>>> {
>>>>>    bool operator ()( const T & ) const { return false; }
>>>>>    typedef T argument_type;
>>>>>    typedef bool result_type;
>>>>> };
>>>>> =20
>>>>> =20
>>>>> If there is no such constructions in C++ Standard I would make a=20
>>>>> proposal.
>>>>>
>>>>

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_429_1255765.1380815155112
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Sorry, I meant a side effect. :)</div><div>&nbsp;</di=
v><div><br>=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013&nbsp;=C7., 1=
9:43:16 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow =CE=C1=
=D0=C9=D3=C1=CC:</div><blockquote class=3D"gmail_quote" style=3D"margin: 0p=
x 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); =
border-left-width: 1px; border-left-style: solid;"><div dir=3D"ltr"><div>As=
 a said effect for example true_predicate could be used in std::copy_if alg=
orithm when&nbsp;there is a general function that uses std::copy_if and you=
 need to use it that to copy all elements of a container.:)</div><div>&nbsp=
;</div><div><br>=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013&nbsp;=
=C7., 14:45:14 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow =
=CE=C1=D0=C9=D3=C1=CC:</div><blockquote class=3D"gmail_quote" style=3D"marg=
in: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, =
204); border-left-width: 1px; border-left-style: solid;"><div dir=3D"ltr"><=
div>I think that it would be even better to define std:: plus the following=
 way</div><div>&nbsp;</div><div>template &lt;class ...T&gt; struct plus;</d=
iv><div>template &lt;class T&gt; struct plus&lt;T&gt; <br>{<br>&nbsp;typede=
f T&nbsp;&nbsp;&nbsp; first_argument_type;<br>&nbsp;typedef T&nbsp;&nbsp;&n=
bsp; second_argument_type;<br>&nbsp;typedef T result_type;<br>&nbsp;constex=
pr bool operator ()( const T &amp;x, const T &amp;y ) const <br>&nbsp;{ <br=
>&nbsp;&nbsp;return ( x + y ); <br>&nbsp;}<br>&nbsp;<br>};</div><div>templa=
te &lt;class T, class U&gt; struct plus&lt;T, U&gt; <br>{<br>&nbsp;typedef =
T&nbsp;&nbsp;&nbsp; first_argument_type;<br>&nbsp;typedef U&nbsp;&nbsp;&nbs=
p; second_argument_type;<br>&nbsp;typedef typename std::common_type&lt;T, U=
&gt;::value result_type;<br>&nbsp;constexpr typename std::common_type&lt;T,=
 U&gt;::value operator ()( const T &amp;x, const U &amp;y ) const <br>&nbsp=
;{ <br>&nbsp;&nbsp;return ( x + y ); <br>&nbsp;}<br>};<br></div><div>instea=
d of the definition in the standard.</div><div>&nbsp;</div><div><br>=DE=C5=
=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013&nbsp;=C7., 14:01:07 UTC+4 =D0=
=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow =CE=C1=D0=C9=D3=C1=CC:</=
div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; p=
adding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width:=
 1px; border-left-style: solid;"><div dir=3D"ltr"><div>If this code is vali=
d then false_predicate (and correspondingly true_predicate) could be define=
d the following way. At least this code is compiled with GCC</div><div>&nbs=
p;</div><div>template &lt;class ...T&gt; struct false_predicate;<br>templat=
e &lt;class T&gt; struct false_predicate&lt;T&gt; <br>{<br>&nbsp;typedef T&=
nbsp;&nbsp;&nbsp; argument_type;<br>&nbsp;typedef bool result_type;<br>&nbs=
p;constexpr bool operator ()( const T &amp; ) const <br>&nbsp;{ <br>&nbsp;&=
nbsp;return ( false ); <br>&nbsp;}<br>&nbsp;<br>};<br>template &lt;class T,=
 class U&gt; struct false_predicate&lt;T, U&gt; <br>{<br>&nbsp;typedef T&nb=
sp;&nbsp;&nbsp; first_argument_type;<br>&nbsp;typedef U&nbsp;&nbsp;&nbsp; s=
econd_argument_type;<br>&nbsp;typedef bool result_type;<br>&nbsp;constexpr =
bool operator ()( const T &amp;, const U &amp; ) const <br>&nbsp;{ <br>&nbs=
p;&nbsp;return ( false ); <br>&nbsp;}<br>};</div><div>&nbsp;</div><div><br>=
=DE=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013&nbsp;=C7., 6:12:47 UTC+=
4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow =CE=C1=D0=C9=D3=C1=
=CC:</div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.=
8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-=
width: 1px; border-left-style: solid;"><div dir=3D"ltr"><div>&nbsp;</div><d=
iv>Maybe something as</div><div>&nbsp;</div><div>template &lt;class T&gt;<b=
r>struct false_predicate<br>{<br>&nbsp;constexpr bool operator ()( const T =
&amp;... ) const { return ( false ); }<br>&nbsp;typedef T&nbsp;&nbsp;&nbsp;=
 argument_type;<br>&nbsp;typedef bool result_type;<br>};</div><div><br>=DE=
=C5=D4=D7=C5=D2=C7, 3 =CF=CB=D4=D1=C2=D2=D1 2013&nbsp;=C7., 4:20:17 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Vlad from Moscow =CE=C1=D0=C9=D3=C1=CC=
:</div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex=
; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-wid=
th: 1px; border-left-style: solid;"><div dir=3D"ltr"><div>Is there in the S=
tandard dummy default unary predicates&nbsp;something as true_predicate and=
 false_predicate?</div><div>&nbsp;</div><div>For example</div><div>&nbsp;</=
div><div>template &lt;class T&gt;</div><div>&nbsp;</div><div>struct true_pr=
edicate</div><div>{</div><div>&nbsp;&nbsp; bool operator ()( const T &amp; =
) const { return true; }</div><div>&nbsp;&nbsp; typedef T argument_type;</d=
iv><div>&nbsp;&nbsp; typedef bool result_type;</div><div>};</div><div>&nbsp=
;</div><div><div>template &lt;class T&gt;</div><div>&nbsp;</div><div>struct=
 false_predicate</div><div>{</div><div>&nbsp;&nbsp; bool operator ()( const=
 T &amp; ) const { return false; }</div><div>&nbsp;&nbsp; typedef T argumen=
t_type;</div><div>&nbsp;&nbsp; typedef bool result_type;</div><div>};</div>=
</div><div>&nbsp;</div><div>&nbsp;</div><div>If there is no such constructi=
ons in C++ Standard I would make a proposal.</div></div></blockquote></div>=
</blockquote></div></blockquote></div></blockquote></div></blockquote></div=
>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_429_1255765.1380815155112--

.


Author: Jonathan Wakely <cxx@kayari.org>
Date: Wed, 9 Oct 2013 08:25:30 -0700 (PDT)
Raw View
------=_Part_70_16718138.1381332330587
Content-Type: text/plain; charset=ISO-8859-1

On Thursday, October 3, 2013 4:43:16 PM UTC+1, Vlad from Moscow wrote:
>
> As a said effect for example true_predicate could be used in std::copy_if
> algorithm when there is a general function that uses std::copy_if and you
> need to use it that to copy all elements of a container.:)
>
>

Use a lambda expression for that.

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_70_16718138.1381332330587
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Thursday, October 3, 2013 4:43:16 PM UTC+1, Vlad from M=
oscow wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-lef=
t: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><=
div>As a said effect for example true_predicate could be used in std::copy_=
if algorithm when&nbsp;there is a general function that uses std::copy_if a=
nd you need to use it that to copy all elements of a container.:)</div><div=
>&nbsp;</div></div></blockquote><div><br>Use a lambda expression for that.<=
/div><br></div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_70_16718138.1381332330587--

.


Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Wed, 9 Oct 2013 09:02:58 -0700 (PDT)
Raw View
------=_Part_1477_5807729.1381334578967
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

It is not a good idea as it seems at the first glance. See discussion at
=20
https://groups.google.com/a/isocpp.org/forum/#!topic/std-discussion/S1kmj0w=
F5-g

=D3=D2=C5=C4=C1, 9 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 19:25:30 UTC+4 =D0=CF=
=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Jonathan Wakely=20
=CE=C1=D0=C9=D3=C1=CC:

> On Thursday, October 3, 2013 4:43:16 PM UTC+1, Vlad from Moscow wrote:
>>
>> As a said effect for example true_predicate could be used in std::copy_i=
f=20
>> algorithm when there is a general function that uses std::copy_if and yo=
u=20
>> need to use it that to copy all elements of a container.:)
>> =20
>>
>
> Use a lambda expression for that.
>
>

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_1477_5807729.1381334578967
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>It is not a good idea as it seems at the first glance=
.. See discussion at</div><div>&nbsp;</div><div><a href=3D"https://groups.go=
ogle.com/a/isocpp.org/forum/#!topic/std-discussion/S1kmj0wF5-g">https://gro=
ups.google.com/a/isocpp.org/forum/#!topic/std-discussion/S1kmj0wF5-g</a></d=
iv><div><br>=D3=D2=C5=C4=C1, 9 =CF=CB=D4=D1=C2=D2=D1 2013&nbsp;=C7., 19:25:=
30 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Jonathan Wakely =CE=C1=D0=C9=
=D3=C1=CC:</div><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px =
0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border=
-left-width: 1px; border-left-style: solid;"><div dir=3D"ltr">On Thursday, =
October 3, 2013 4:43:16 PM UTC+1, Vlad from Moscow wrote:<blockquote class=
=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; bor=
der-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-sty=
le: solid;"><div dir=3D"ltr"><div>As a said effect for example true_predica=
te could be used in std::copy_if algorithm when&nbsp;there is a general fun=
ction that uses std::copy_if and you need to use it that to copy all elemen=
ts of a container.:)</div><div>&nbsp;</div></div></blockquote><div><br>Use =
a lambda expression for that.</div><br></div></blockquote></div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_1477_5807729.1381334578967--

.


Author: Jonathan Wakely <cxx@kayari.org>
Date: Fri, 11 Oct 2013 06:19:40 -0700 (PDT)
Raw View
------=_Part_150_25943030.1381497580753
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable



On Wednesday, October 9, 2013 5:02:58 PM UTC+1, Vlad from Moscow wrote:
>
> It is not a good idea as it seems at the first glance. See discussion at
> =20
>
> https://groups.google.com/a/isocpp.org/forum/#!topic/std-discussion/S1kmj=
0wF5-g
>

Why do you need a lambda as a default template argument to use std::copy_if=
?

=20

> =D3=D2=C5=C4=C1, 9 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 19:25:30 UTC+4 =D0=CF=
=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Jonathan Wakely=20
> =CE=C1=D0=C9=D3=C1=CC:
>
>> On Thursday, October 3, 2013 4:43:16 PM UTC+1, Vlad from Moscow wrote:
>>>
>>> As a said effect for example true_predicate could be used in=20
>>> std::copy_if algorithm when there is a general function that uses=20
>>> std::copy_if and you need to use it that to copy all elements of a=20
>>> container.:)
>>> =20
>>>
>>
>> Use a lambda expression for that.
>>
>>

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_150_25943030.1381497580753
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Wednesday, October 9, 2013 5:02:58 PM UTC+1, Vl=
ad from Moscow wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;m=
argin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=
=3D"ltr"><div>It is not a good idea as it seems at the first glance. See di=
scussion at</div><div>&nbsp;</div><div><a href=3D"https://groups.google.com=
/a/isocpp.org/forum/#!topic/std-discussion/S1kmj0wF5-g" target=3D"_blank">h=
ttps://groups.google.com/a/<wbr>isocpp.org/forum/#!topic/std-<wbr>discussio=
n/S1kmj0wF5-g</a><br></div></div></blockquote><div><br>Why do you need a la=
mbda as a default template argument to use std::copy_if?<br><br>&nbsp;</div=
><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;bo=
rder-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div>=D3=D2=
=C5=C4=C1, 9 =CF=CB=D4=D1=C2=D2=D1 2013&nbsp;=C7., 19:25:30 UTC+4 =D0=CF=CC=
=D8=DA=CF=D7=C1=D4=C5=CC=D8 Jonathan Wakely =CE=C1=D0=C9=D3=C1=CC:</div><bl=
ockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;padding-le=
ft:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left=
-style:solid"><div dir=3D"ltr">On Thursday, October 3, 2013 4:43:16 PM UTC+=
1, Vlad from Moscow wrote:<blockquote class=3D"gmail_quote" style=3D"margin=
:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);bord=
er-left-width:1px;border-left-style:solid"><div dir=3D"ltr"><div>As a said =
effect for example true_predicate could be used in std::copy_if algorithm w=
hen&nbsp;there is a general function that uses std::copy_if and you need to=
 use it that to copy all elements of a container.:)</div><div>&nbsp;</div><=
/div></blockquote><div><br>Use a lambda expression for that.</div><br></div=
></blockquote></div></blockquote></div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_150_25943030.1381497580753--

.


Author: Vlad from Moscow <vlad.moscow@mail.ru>
Date: Fri, 11 Oct 2013 07:12:46 -0700 (PDT)
Raw View
------=_Part_627_62207.1381500766773
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

std::copy_if was taken simply as an example. If you need to write a general=
=20
function that can be called with a predicate or without a predicate then=20
you can use false_predicate and true_predicate as default predicates. For=
=20
example
=20
void some_function( Container &c, Predicate =3D=20
true_predicate<Container::value_type>() )
{
/* some code */
}
=20
Then you call it for example
=20
=20
some_cunction( c, std::greater<Container::value_type>() );
=20
or if you need specify a predicate then you call it simply as
=20
some_function( c );
=20
I described a simple example that demonstrates the idea in my post at
=20
http://cpp.forum24.ru/?1-3-0-00000066-000-0-0-1380811383
=20
Though it is written in Russian but the content of the post is clear even=
=20
without a translation though you can use goofle translate.
=20

=D0=D1=D4=CE=C9=C3=C1, 11 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 17:19:40 UTC+4 =
=D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Jonathan Wakely=20
=CE=C1=D0=C9=D3=C1=CC:

>
>
> On Wednesday, October 9, 2013 5:02:58 PM UTC+1, Vlad from Moscow wrote:
>>
>> It is not a good idea as it seems at the first glance. See discussion at
>> =20
>>
>> https://groups.google.com/a/isocpp.org/forum/#!topic/std-discussion/S1km=
j0wF5-g
>>
>
> Why do you need a lambda as a default template argument to use=20
> std::copy_if?
>
> =20
>
>> =D3=D2=C5=C4=C1, 9 =CF=CB=D4=D1=C2=D2=D1 2013 =C7., 19:25:30 UTC+4 =D0=
=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 Jonathan Wakely=20
>> =CE=C1=D0=C9=D3=C1=CC:
>>
>>> On Thursday, October 3, 2013 4:43:16 PM UTC+1, Vlad from Moscow wrote:
>>>>
>>>> As a said effect for example true_predicate could be used in=20
>>>> std::copy_if algorithm when there is a general function that uses=20
>>>> std::copy_if and you need to use it that to copy all elements of a=20
>>>> container.:)
>>>> =20
>>>>
>>>
>>> Use a lambda expression for that.
>>>
>>>

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

------=_Part_627_62207.1381500766773
Content-Type: text/html; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>std::copy_if was taken simply as an example. If you n=
eed to write a general function that can be called with a predicate or with=
out a predicate then you can use false_predicate and true_predicate as defa=
ult predicates. For example</div><div>&nbsp;</div><div>void some_function( =
Container &amp;c, Predicate =3D true_predicate&lt;Container::value_type&gt;=
() )</div><div>{</div><div>/* some code */</div><div>}</div><div>&nbsp;</di=
v><div>Then you call it for example</div><div>&nbsp;</div><div>&nbsp;</div>=
<div>some_cunction( c, std::greater&lt;Container::value_type&gt;() );</div>=
<div>&nbsp;</div><div>or if you need specify a predicate then you call it s=
imply as</div><div>&nbsp;</div><div>some_function( c );</div><div>&nbsp;</d=
iv><div>I described a simple example that demonstrates the idea in my post =
at</div><div>&nbsp;</div><div><a href=3D"http://cpp.forum24.ru/?1-3-0-00000=
066-000-0-0-1380811383">http://cpp.forum24.ru/?1-3-0-00000066-000-0-0-13808=
11383</a></div><div>&nbsp;</div><div>Though it is written in Russian but th=
e content of the post is clear even without a translation though you can us=
e goofle translate.</div><div>&nbsp;</div><div><br>=D0=D1=D4=CE=C9=C3=C1, 1=
1 =CF=CB=D4=D1=C2=D2=D1 2013&nbsp;=C7., 17:19:40 UTC+4 =D0=CF=CC=D8=DA=CF=
=D7=C1=D4=C5=CC=D8 Jonathan Wakely =CE=C1=D0=C9=D3=C1=CC:</div><blockquote =
class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex=
; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-lef=
t-style: solid;"><div dir=3D"ltr"><br><br>On Wednesday, October 9, 2013 5:0=
2:58 PM UTC+1, Vlad from Moscow wrote:<blockquote class=3D"gmail_quote" sty=
le=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(=
204, 204, 204); border-left-width: 1px; border-left-style: solid;"><div dir=
=3D"ltr"><div>It is not a good idea as it seems at the first glance. See di=
scussion at</div><div>&nbsp;</div><div><a href=3D"https://groups.google.com=
/a/isocpp.org/forum/#!topic/std-discussion/S1kmj0wF5-g" target=3D"_blank">h=
ttps://groups.google.com/a/<wbr>isocpp.org/forum/#!topic/std-<wbr>discussio=
n/S1kmj0wF5-g</a><br></div></div></blockquote><div><br>Why do you need a la=
mbda as a default template argument to use std::copy_if?<br><br>&nbsp;</div=
><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padd=
ing-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1p=
x; border-left-style: solid;"><div dir=3D"ltr"><div>=D3=D2=C5=C4=C1, 9 =CF=
=CB=D4=D1=C2=D2=D1 2013&nbsp;=C7., 19:25:30 UTC+4 =D0=CF=CC=D8=DA=CF=D7=C1=
=D4=C5=CC=D8 Jonathan Wakely =CE=C1=D0=C9=D3=C1=CC:</div><blockquote class=
=3D"gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; padding-left: 1ex; bor=
der-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-sty=
le: solid;"><div dir=3D"ltr">On Thursday, October 3, 2013 4:43:16 PM UTC+1,=
 Vlad from Moscow wrote:<blockquote class=3D"gmail_quote" style=3D"margin: =
0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204)=
; border-left-width: 1px; border-left-style: solid;"><div dir=3D"ltr"><div>=
As a said effect for example true_predicate could be used in std::copy_if a=
lgorithm when&nbsp;there is a general function that uses std::copy_if and y=
ou need to use it that to copy all elements of a container.:)</div><div>&nb=
sp;</div></div></blockquote><div><br>Use a lambda expression for that.</div=
><br></div></blockquote></div></blockquote></div></blockquote></div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_627_62207.1381500766773--

.


Author: Jonathan Wakely <cxx@kayari.org>
Date: Fri, 11 Oct 2013 08:05:12 -0700 (PDT)
Raw View
------=_Part_762_25602450.1381503912522
Content-Type: text/plain; charset=ISO-8859-1

On Friday, October 11, 2013 3:12:46 PM UTC+1, Vlad from Moscow wrote:
>
>
>
> I described a simple example that demonstrates the idea in my post at
>
> http://cpp.forum24.ru/?1-3-0-00000066-000-0-0-1380811383
>
> Though it is written in Russian but the content of the post is clear even
> without a translation though you can use goofle translate.
>

I understand the idea, I just don't buy the motivation, I'm not convinced
it's useful enough to standardise.

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_762_25602450.1381503912522
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Friday, October 11, 2013 3:12:46 PM UTC+1, Vlad from Mo=
scow wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left=
: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><b=
r><div>&nbsp;</div><div>I described a simple example that demonstrates the =
idea in my post at</div><div>&nbsp;</div><div><a href=3D"http://cpp.forum24=
..ru/?1-3-0-00000066-000-0-0-1380811383" target=3D"_blank">http://cpp.forum2=
4.ru/?1-3-0-<wbr>00000066-000-0-0-1380811383</a></div><div>&nbsp;</div><div=
>Though it is written in Russian but the content of the post is clear even =
without a translation though you can use goofle translate.</div></div></blo=
ckquote><div><br>I understand the idea, I just don't buy the motivation, I'=
m not convinced it's useful enough to standardise.</div><br></div>

<p></p>

-- <br />
&nbsp;<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_762_25602450.1381503912522--

.