Sunday, December 3, 2017

Digest for comp.lang.c++@googlegroups.com - 10 updates in 5 topics

mcheung63@gmail.com: Dec 03 09:51AM -0800

Hi All
Is rust going to replace C++? The world seems want to stay in C++
Thanks
Peter
 
---------------------------------------------------------------------------------------------------------
Rick (rick.c.hodgin@gmail.com) is not welcome to this post. He is a fucking asshole, keep spamming different newsgroups
---------------------------------------------------------------------------------------------------------
woodbrian77@gmail.com: Dec 03 11:27AM -0800

> Is rust going to replace C++? The world seems want to stay in C++
> Thanks
> Peter
 
Please don't swear here.
 
 
Brian
Ebenezer Enterprises
http://webEbenezer.net
Vir Campestris <vir.campestris@invalid.invalid>: Dec 03 08:54PM

>> Thanks
>> Peter
 
> Please don't swear here.
 
:)
 
I hear lots of people talking about Rust. I haven't yet met anyone
writing it.
 
For that matter, I see a lot of C code where C++ would do a better job,
and would work fine on the platform.
 
Some of that C code is in .cpp files :(
 
Andy
guinness.tony@gmail.com: Dec 03 03:09PM -0800

> > Thanks
> > Peter
 
> Please don't swear here.
 
I know you are cranky about what you consider swearing but which of the words (that you quoted, above) are you claiming to be "swearing"?
ram@zedat.fu-berlin.de (Stefan Ram): Dec 03 08:56AM

>namespace that type is defined in. If there's an identifier in
>::kuyper::std that is the same as one in ::std, use of std:: will not
>resolve the ambiguity as to which one is to be used. Such identifiers
 
I believe that »::std::any_of« calls »std::none_of« in the
C++ implementation I use, so I tried to make »::std::any_of«
call my custom »std::none_of«. But my attempt did not succeed.
Maybe someone can improve on my botched attempt?
 
main.cpp
 
#include <iostream> // ::std::cout
#include <ostream> // <<
#include <algorithm> // ::std::any_of
#include <vector> // ::std::vector
 
namespace example
{
namespace std
{
template< typename InputIterator, typename Predicate >
inline bool none_of( InputIterator, InputIterator, Predicate )
{ ::std::cerr << "none_of was called.\n"; return 1; }}
/* end of namespace std */
 
enum class letter { A, B, C, D, E, F, G };
bool operator <( letter i, letter j )
{ return static_cast< int >( i )< static_cast< int >( j ); }
 
class vector : public ::std::vector< letter >
{ public: using ::std::vector< letter >::vector; }; }
/* end of namespace example */
 
int main ()
{ ::example::vector const a ={ ::example::letter::A };
::std::cout <<
( ::std::any_of
( a.begin(),
a.end(),
[]( ::example::letter i ){ return i < ::example::letter::B; }))
<< '\n'; }
 
transcript
 
1
ram@zedat.fu-berlin.de (Stefan Ram): Dec 03 07:06PM

>argument-dependent name lookup (3.4.2) can occur that searches the
...
>functions uses std:: instead of ::std::.
 
An argument-dependent name lookup (6.4.2) is performed when
the postfix-expression in a function call is an unqualified-id.
 
This does not apply to a call like »std::f()«
(because »std::f« is not an unqualified-id).
"Mr. Man-wai Chang" <toylet.toylet@gmail.com>: Dec 04 01:36AM +0800

> Rick has been spamming comp.lang.c++ for a year.
 
Christians, Islams, Muslims, Buddhism and all kinds of religions are
always spamming internet and physical reality all the time? Their Holy
War against non-believers? :)
 
--
@~@ Remain silent! Drink, Blink, Stretch! Live long and prosper!!
/ v \ Simplicity is Beauty!
/( _ )\ May the Force and farces be with you!
^ ^ (x86_64 Ubuntu 9.10) Linux 2.6.39.3
不借貸! 不詐騙! 不援交! 不打交! 不打劫! 不自殺! 請考慮綜援 (CSSA):
http://www.swd.gov.hk/tc/index/site_pubsvc/page_socsecu/sub_addressesa
Rick C Hodgin <rickchodginjesus@gmail.com>: Dec 03 09:29AM -0800

On Saturday, December 2, 2017 at 5:58:41 AM UTC+8, Chris Vine wrote:
> [snip]
 
> This is off topic in a C++ newsgroup and you are responding to a known
> spammer. It would be great if you could desist.
 
Hi Chris. He is a fucking asshole and spamming different groups.
"Alf P. Steinbach" <alf.p.steinbach+usenet@gmail.com>: Dec 03 03:26AM +0100

On 12/3/2017 12:15 AM, James Kuyper wrote:
> of the C++ standard library that I choose to use in my program must also
> avoid any use of constructs that would be broken by my definition of
> ::kuyper::std.
 
I think you need to demonstrate the ability to break the code of some
standard library implementation, in order to make this argument plausible.
 
 
Cheers!,
 
- Alf
James Kuyper <jameskuyper@verizon.net>: Dec 02 10:55PM -0500

On 12/02/2017 09:26 PM, Alf P. Steinbach wrote:
>> ::kuyper::std.
 
> I think you need to demonstrate the ability to break the code of some
> standard library implementation, in order to make this argument plausible.
 
I've been avoiding giving an example for one simple reason: while I've
got a lot of knowledge about C++, I've relatively little experience
writing it. The way in which such breakage could happen seems quite
obvious to me, but I'm afraid that if I tried to write example code, I'd
mess up one of the subtle details, which would end up being the focus of
the ensuing discussion, ignoring the fact that the subtle detail could
easily be fixed.
The key thing is that C++ standard library templates (whether template
classes or template functions) can be instantiated using user-defined
types. When one of those types appears as the argument of a function,
argument-dependent name lookup (3.4.2) can occur that searches the
namespace that type is defined in. If there's an identifier in
::kuyper::std that is the same as one in ::std, use of std:: will not
resolve the ambiguity as to which one is to be used. Such identifiers
are reserved only in ::std and in the global namespace (17.6.4.3.3p1),
so use of such identifiers in ::kuyper::std should not be problematic,
but it would be if some of the standard C++ library code for such
functions uses std:: instead of ::std::.
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: