Pavel <pauldontspamtolk@removeyourself.dontspam.yahoo>: Feb 27 12:24AM -0500 Melzzzzz wrote: >> reinterpret_cast (in this case, from the pointer to e or its first element) to >> obtain the pointer to that complete object (created by the placement new). > Without that you couldn't implement allocator in C++... I think gcc-9.2 C++ Standard Library implements std::allocator without using reinterpret_cast (some other non-standard allocators provided with the library do use it but that does not invalidate the point). Of course above I assume that the allocation functions "... void* operator new ..." are not parts of std::allocator implementation but underlying low-level implementation details. On a side note, it is telling that reinterpret_cast is not used in this implementation even though it is a special library packed with the compiler and as such it is the one library that _could_ use the compiler's implementation-specific behavior (including that of reinterpret_cast) without running afoul of the Standard. |
Pavel <pauldontspamtolk@removeyourself.dontspam.yahoo>: Feb 27 12:50AM -0500 Öö Tiib wrote: >> development, of all things. > I have observed same thing. Hiring C++ programmers has became > hard. Hiring a COBOL or FORTRAN-66 programmer could be even harder :-). Just kidding. > (or outright web servers) into their embedded equipment while > being resistant to increase bills of materials. > Can be raise in usage of hand-held stuff and battery life of such. I think unexpectedly relevant to this is David Gross's talk on C++ micro-benchmarking at https://www.youtube.com/watch?v=Czr5dBfs72U. Hopefully listening to the talk will be worth it for some people here for its main subject; but it is also preceded with a number of reasons for why we may want to write in C++ with one being saving the world the from climate change. I found it ironic but also convincing (of course it is easy to get convinced that you are saving the world so I might be biased here): In a typical infrastructure of a tech firm running few hundreds or thousands power-hungry UNIX servers replacing Java (not to mention Python and such) with decently written C++ code can easily make possible to retire two-third of them. |
Maciej Sobczak <see.my.homepage@gmail.com>: Feb 26 11:55PM -0800 > I don't see what's curious about it though: C++ is a drop-in > replacement for C from a runtime perspective. Unless you have messed up your run-time so much (or you have so little of it), that the replacement is not possible at all. This is usually not a concern on desktop or on server, where developers treat the runtime as a black-box part of the development environment, but occasionally happens in the world of embedded systems, where engineers are more keen hacking their own linker scripts or startup sequences. If you mess it up to the extent that nobody wants to support it any longer, then introducing the programming language that is much more demanding with its constructors of static objects, virtual function tables, exceptions and what not, might be a challenge that nobody will want to take. I can imagine teams getting stuck like this forever. But fortunately, hardware vendors provide complete IDEs that handle both C and C++ reasonably well, so this should not be a concern for new projects. As a personal story, I have recently managed to port a mature high-level C++ messaging library to several embedded platforms without any issues caused by the language, the only challenge being the peculiarities of the target real-time operating systems and their network stacks. This positive porting experience allows me to treat C++ as a perfectly validated solution for embedded systems and I expect to see more of it in this space. -- Maciej Sobczak * http://www.inspirel.com |
Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: Feb 27 11:21AM On Thu, 27 Feb 2020 00:24:15 -0500 > as such it is the one library that _could_ use the compiler's > implementation-specific behavior (including that of reinterpret_cast) without > running afoul of the Standard. You keep going on about reinterpret_cast. To remind you, the code in question which you previously said had undefined behaviour, and you now seem to say has implementation defined behaviour, is this: struct Y {int z;}; alignas(Y) std::byte s[sizeof(Y)]; Y* q = new(&s) Y{2}; const int h = std::launder(reinterpret_cast<Y*>(&s))->z; So just what behaviour do you think is implementation-defined here? Some uses of reinterpret_cast can have implementation defined behaviour (the mapping of pointer to integer, and the effect of conversions between object pointer and function pointer) but these are not relevant here. Just repeating yourself does not make what you say true. Let's have a proper explanation, preferably with reference to some authoritative work[1]. Chris [1] There are some issues to consider in addition to aliasing and alignment previously mentioned (for example, what address does the global placement new operator return by reference to the address of its void* argument). Unfortunately you are on the wrong side of that one also. |
Rosario19 <Ros@invalid.invalid>: Feb 27 10:56AM +0100 On Thu, 27 Feb 2020 10:43:09 +0100, Rosario19 wrote: >On Thu, 27 Feb 2020 10:39:20 +0100, Rosario19 wrote: if someone want reduce humans to 0? this virus would be ok: 1 phase 7 14 30 60 360 days of asintomatic spread exponential 2 phase the ill, with reinfetion or reemerge and the death 100% in this wrost case the only is auto quarantine for enought time there is something as 2 week i prepare go to supermarket etc i for me begin one quarantine 2 months with 0 exit out but i have some problem possible i have to exit too |
Rosario19 <Ros@invalid.invalid>: Feb 27 11:35AM +0100 On Thu, 27 Feb 2020 10:56:06 +0100, Rosario19 wrote: >there is something as 2 week i prepare go to supermarket etc >i for me begin one quarantine 2 months with 0 exit out >but i have some problem possible i have to exit too visto che le mascherine nn funzionano al 100% visto che la quarantena nn funziona poichè il virus si nasconde nell'organismo e riemerge (ipotesi) inoltre casi di 30gg , 42 gg asintomatici visto che i test hanno percentuali elevati di falsi negativi almeno in Cina del 50% cioe uno su due (in pratica basta 1 su 10000 e la malattia si diffonde esponenzialmente lo stesso) vista la Cina che si blocca tutta (i morti nn li contano x me) l'unica era bloccare tutto , frontiere, rifuggiati, migranti, turisti aerei, navi tutto... nn lo hanno fatto, si prenderanno le loro responsabilità (se qualcuno in italia rimane vivo) spero che sia solo influenza ma da come si comporta la Cina nn sembra proprio l'influenza Preghiamo Dio che ce la possiamo scappottare, magari se inizia la primavera in aticipo con piu caldo e al virus gli viene difficile circolare , anche se potrebbbe rimanere nel corpo dei portatori sani , che si potranno successivamente ammalare o diffondere il virus. x parte mia vorrei fare una quarantena di 3 mesi, o 2 mesi, con 0 uscite è l'unica che rimane poiche si diffonde anche da quelli che credono di stare bene, o che i tamponi, i test, sbagliando, fanno risultare negativi. |
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:
Post a Comment