Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > C++: auto_ptr, binders deprecated

Reply
Thread Tools

C++: auto_ptr, binders deprecated

 
 
lovecreatesbea...@gmail.com
Guest
Posts: n/a
 
      07-08-2010
the 2010, 03 draft std of C++ states that

auto_ptr deprecated, use shared_ptr (boost?) instead; binders:
bind1st, bind2nd, .. deprecated, use bind instead.

were there features in C abandoned so soon like that in C++? those C++
features dismissed even before many programmers didn't have a single
try. the author said, the things you didnt know about C++ wont hurt yo.
 
Reply With Quote
 
 
 
 
David Resnick
Guest
Posts: n/a
 
      07-08-2010
On Jul 8, 10:24*am, "lovecreatesbea...@gmail.com"
<lovecreatesbea...@gmail.com> wrote:
> the 2010, 03 draft std of C++ states that
>
> auto_ptr deprecated, use shared_ptr (boost?) instead; binders:
> bind1st, bind2nd, .. deprecated, use bind instead.
>
> were there features in C abandoned so soon like that in C++? those C++
> features dismissed even before many programmers didn't have a single
> try. the author said, the things you didnt know about C++ wont hurt yo.


gets was just like that. They gave it to us and BOOM, they took it
away. Those evil standards folks.

if you are humor impaired. C has been pretty stable for quite some
time, some see that as bad, some as a feature.
 
Reply With Quote
 
 
 
 
Nick Keighley
Guest
Posts: n/a
 
      07-08-2010
On 8 July, 15:40, David Resnick <lndresn...@gmail.com> wrote:
> On Jul 8, 10:24*am, "lovecreatesbea...@gmail.com"
> <lovecreatesbea...@gmail.com> wrote:



> > the 2010, 03 draft std of C++ states that

>
> > auto_ptr deprecated, use shared_ptr (boost?) instead; binders:
> > bind1st, bind2nd, .. deprecated, use bind instead.

>
> > were there features in C abandoned so soon like that in C++? those C++
> > features dismissed even before many programmers didn't have a single
> > try. the author said, the things you didnt know about C++ wont hurt yo.


auto_ptr has been around a long time! At one time I gave up on C++ as
it seemed to change every 5 minutes.

> gets was just like that. *They gave it to us and BOOM, they took it
> away. *Those evil standards folks.
>
> if you are humor impaired. *C has been pretty stable for quite some
> time, some see that as bad, some as a feature.


"auto" keyword is almost useless
did early C have "fortran" and "entry" keywords or was that just a
rumour?
 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      07-08-2010
Nick Keighley <> writes:
[...]
> "auto" keyword is almost useless


Which is why C++ is re-using it for a new purpose.

> did early C have "fortran" and "entry" keywords or was that just a
> rumour?


K&R1, Appendix A, 2.3:

The entry keyword is not currently implemented by any compiler
but is reserved for future use. Some implementations also
reserve the words fortran and asm.

K&R2 mentions "fortran" and "asm".

Both C90 and C99 mention the "fortran" and "asm" keywords under
"Common extensions"; neither mentions "entry".

I think the original intent of "entry" was to permit alternative entry
points to be defined for functions, making it easier, for example, to
define sin() and cos() as a single function. Fortran has such a
feature.

--
Keith Thompson (The_Other_Keith) kst- <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
Nick
Guest
Posts: n/a
 
      07-09-2010
"lovecreatesbea...@gmail.com" <> writes:

> the 2010, 03 draft std of C++ states that
>
> auto_ptr deprecated, use shared_ptr (boost?) instead; binders:
> bind1st, bind2nd, .. deprecated, use bind instead.
>
> were there features in C abandoned so soon like that in C++? those C++
> features dismissed even before many programmers didn't have a single
> try. the author said, the things you didnt know about C++ wont hurt yo.


Trigraphs (says he who used some of them once)?
--
Online waterways route planner | http://canalplan.eu
Plan trips, see photos, check facilities | http://canalplan.org.uk
 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      07-09-2010
Nick <3-> writes:
> "lovecreatesbea...@gmail.com" <> writes:
>> the 2010, 03 draft std of C++ states that
>>
>> auto_ptr deprecated, use shared_ptr (boost?) instead; binders:
>> bind1st, bind2nd, .. deprecated, use bind instead.
>>
>> were there features in C abandoned so soon like that in C++? those C++
>> features dismissed even before many programmers didn't have a single
>> try. the author said, the things you didnt know about C++ wont hurt yo.

>
> Trigraphs (says he who used some of them once)?


Trigraphs are rarely used, but they've never been officially
deprecated. (And I understand that there are still environments
where there necessary and actually used.)

I'd have preferred a solution that can be completely ignored when
it's not needed, e.g., disabling trigraphs unless a specific #pragma
appears at the top of the source file. Figuring out how to spell
"#pragma" without trigraphs is a bit of an obstacle to this, but
not an insurmountable one.

--
keith Thompson (The_Other_Keith) kst- <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
Nick
Guest
Posts: n/a
 
      07-09-2010
Richard Heathfield <> writes:

> Keith Thompson wrote:
>
> <snip>
>
>> Trigraphs are rarely used, but they've never been officially
>> deprecated. (And I understand that there are still environments
>> where there necessary and actually used.)

>
> Yes, they are still needed, for example in some mainframe
> environments. They make the code look astoundingly ugly, but they do
> at least make it work. It is not uncommon for "normal" C code to be
> written and tested on PCs, then run through a conversion program to
> replace monographs with trigraphs where required before transfer to
> the mainframe for final testing. That way, you get the readability
> where it matters, and the usability where /that/ matters.
>
> <snip>


But is there anything you can do with them that you can't do with the
more readable digraphs that came along later.

The problem with using them for mainframes, IIRC (it's nearly 20 years
ago since I did this) was that not everything that gets mucked about by
IBM code pages is in the trigraph set.
--
Online waterways route planner | http://canalplan.eu
Plan trips, see photos, check facilities | http://canalplan.org.uk
 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      07-10-2010
Nick <3-> writes:
> Richard Heathfield <> writes:
>> Keith Thompson wrote:
>> <snip>
>>
>>> Trigraphs are rarely used, but they've never been officially
>>> deprecated. (And I understand that there are still environments
>>> where there necessary and actually used.)

>>
>> Yes, they are still needed, for example in some mainframe
>> environments. They make the code look astoundingly ugly, but they do
>> at least make it work. It is not uncommon for "normal" C code to be
>> written and tested on PCs, then run through a conversion program to
>> replace monographs with trigraphs where required before transfer to
>> the mainframe for final testing. That way, you get the readability
>> where it matters, and the usability where /that/ matters.
>>
>> <snip>

>
> But is there anything you can do with them that you can't do with the
> more readable digraphs that came along later.


Yes. Digraphs aren't recognized in string literals, character
constants, header names, or comments (the latter probably isn't
important).

> The problem with using them for mainframes, IIRC (it's nearly 20 years
> ago since I did this) was that not everything that gets mucked about by
> IBM code pages is in the trigraph set.


--
Keith Thompson (The_Other_Keith) kst- <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
sandeep
Guest
Posts: n/a
 
      07-10-2010
Nick Keighley writes:
> "auto" keyword is almost useless
> did early C have "fortran" and "entry" keywords or was that just a
> rumour?


I think it still has some valuable uses.

For example in a function with lots of static variables and only one or
two local variables, putting in an explicit auto can help emphasize that
there are local variables at the end of the long list.

Also it can be used to demonstrate the programmer's wide knowledge of the
ISO Standard, in the way that flowery and obscure vocabulary is used by
some writers to impress their readers... a bit of showing off to impress
the maintenance programmer down the line
 
Reply With Quote
 
Ian Collins
Guest
Posts: n/a
 
      07-10-2010
On 07/10/10 10:25 PM, sandeep wrote:
> Nick Keighley writes:
>> "auto" keyword is almost useless
>> did early C have "fortran" and "entry" keywords or was that just a
>> rumour?

>
> I think it still has some valuable uses.
>
> For example in a function with lots of static variables and only one or
> two local variables, putting in an explicit auto can help emphasize that
> there are local variables at the end of the long list.


Surely the lack of "static" has as much, if not more impact?

--
Ian Collins
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't use STL algorithms and binders with function that has referenceparameter massysett C++ 6 12-15-2007 04:14 PM
binders to members of members Diego Martins C++ 3 11-23-2005 05:54 PM
Diggins PDP #2 : Meta-Binders (binding functions to functions) christopher diggins C++ 1 05-23-2005 09:05 AM
STL: Searching with binders and predicates Maitre Bart C++ 0 10-21-2004 11:14 PM
Deprecated warnings within deprecated code Barney Barumba Java 0 07-23-2003 12:46 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57