Sunday, December 7, 2014

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

comp.lang.c++@googlegroups.com Google Groups
Unsure why you received this message? You previously subscribed to digests from this group, but we haven't been sending them for a while. We fixed that, but if you don't want to get these messages, send an email to comp.lang.c+++unsubscribe@googlegroups.com.
"J.A. Belloc" <jabelloc@gmail.com>: Dec 07 03:03PM -0800

Consider the following snippet:
 
struct A{ int i; A(int j): i(j){} };
int main()
{
A a(1), b(2);
b = a;
}
 
The expression `b = a;` doesn't apply the lvalue-to-rvalue conversion to `a` because b.operator=(a) is invoked by the compiler and there is no need to invoke the alluded conversion, as the lvalue `a` binds to the argument (const A&) of the assignment operator. Also, AFAICT this happens for every operator, whose operand is a class type. Thus, I'd like to see, if possible, one single example of the lvalue-to-rvalue conversion being applied to a class type. Otherwise, I ask, why does §4.1/1 in the Standard refer to this conversion?
"J.A. Belloc" <jabelloc@gmail.com>: Dec 07 01:37PM -0800

class A{};
A a;
A b;
b = a;
 
The expression `b = a;` doesn't apply the lvalue-to-rvalue conversion on `a`, because the b.operator=(a) is called instead, and this operator, having const A& as argument, accepts the lvalue `a` as argument, i.e., there is no need of an lvalue-to-rvalue conversion. AFAICT, the same would happen to any other operator with a class type operand.
 
I'm curious to see one example of the lvalue-to-rvalue conversion applied to a class type, if this is possible. Otherwise, why does §4.1/1 in the C++ Standard mentions this conversion applied to class types?
Jorgen Grahn <grahn+nntp@snipabacken.se>: Dec 07 11:06AM

On Tue, 2014-11-04, Juha Nieminen wrote:
>> aren't they?
 
> I don't think you can rely on that. IIRC the newest gcc does not bring
> them to the global namespace if you use the <c...> versions.
 
I thought so too, but I cannot repeat it now. That's unfortunate -- I
really want as much as possible to stay away from the global namespace,
so I can use it myself.
 
Then there's the case where you're really using POSIX or Linux
versions of the headers rather than the basic C++ ones. Then IMO
you should definitelty use e.g. errno.h rather than cerrno.
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
TDH1978 <thedeerhunter1978@movie.uni>: Dec 06 06:59PM -0500

User-Agent: Unison/2.1.10
 
Does anyone know if the proposed C++17 networking library is the same
as (or based on) the current boost::asio networking library?
Melzzzzz <mel@zzzzz.com>: Dec 07 01:19AM +0100

On Sat, 6 Dec 2014 18:59:22 -0500
 
> User-Agent: Unison/2.1.10
 
> Does anyone know if the proposed C++17 networking library is the same
> as (or based on) the current boost::asio networking library?
 
Wow C++ will have standard networking library by year 2017 ;)
"Öö Tiib" <ootiib@hot.ee>: Dec 06 09:46PM -0800

On Sunday, 7 December 2014 01:59:32 UTC+2, TDH1978 wrote:
> User-Agent: Unison/2.1.10
 
> Does anyone know if the proposed C++17 networking library is the same
> as (or based on) the current boost::asio networking library?
 
The C++ standardization papers are published open to read for anyone
and networking proposal is there somewhere. I think that one:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4332.html
 
Yes the proposal is mostly derived from Boost.Asio.
Daniel <danielaparker@gmail.com>: Dec 06 06:57PM -0800

On Saturday, December 6, 2014 5:43:18 PM UTC-5, Chris M. Thomasson wrote:
 
> Perhaps take a look at these coding standards:
 
> http://www.stroustrup.com/JSF-AV-rules.pdf
 
It's interesting that while there are a couple of competing C++ class naming
conventions that have a large following, Stroustrup proposes one
that hardly anybody will recognize:
 
"The first word of the name of a class, structure, namespace, enumeration, or
type created with typedef will begin with an uppercase letter. All others
letters will be lowercase.
 
Example:
class Diagonal_matrix { ... }; // Only first letter is capitalized;"
 
Daniel
"Öö Tiib" <ootiib@hot.ee>: Dec 06 09:27PM -0800

On Sunday, 7 December 2014 00:35:20 UTC+2, David Harmon wrote:
> buffer overflows, file failures, and all the normal security bugs
> that are all over modern operating systems and the internet. That's
> way more efficient than exceptions.
 
Yes but unfortunately a long list of defects and issues is even less
popular among customers than inefficiency. After fixing defects they
will have all the hard way of corner case handling and that is
inefficient.
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: