Re: V7R3 C++ questions

"Aaron Albertson" <albertaa-r/[email protected]>
Newsgroups gmane.comp.lang.as400.c
Message-ID <OF943BC1E9.B870F853-ON002580BC.0067FC6B-862580BC.00692576@notes.na.collabserv.com>
Hi Kelly,

	The IBM i 7.3 compiler is not fully C++ 11 compliant.  According to
the reference that I linked, in the 'Extensions for C++ 11 compatibility':
"IBM® supports selected features of C++11, known as C++0x before its
ratification. IBM will continue to develop and implement the features of
the new standard.".  The text continues with some caveats and boilerplate,
but that is the important part for this discussion.

	There is also a table of the supported C++ 11 compiler features in
the linked document.  That table does not make any mention of runtime
features, and I do not know if there is a similar table listing the
supported runtime features.  Hopefully one of the compiler folks can tell
us if there is such a table.  I took a quick look at the header for the
string class though, and I can definitively say that the shrink_to_fit
member function is not present.

Thanks,

Aaron Albertson


"C400-L" <c400-l-bounces-Zwy7GipZuJhWk0Htik3J/[email protected]> wrote on 02/03/2017 12:41:11 PM:

> From: Kelly Beard <[email protected]>
> To: "Bare Metal Programming IBM i (AS/400 and iSeries)"
<c400-l-Zwy7GipZuJhWk0Htik3J/[email protected]>
> Date: 02/03/2017 12:41 PM
> Subject: Re: [C400-L] V7R3 C++ questions
> Sent by: "C400-L" <c400-l-bounces-Zwy7GipZuJhWk0Htik3J/[email protected]>
>
> The reason why I'm asking is because the program below does not seem to
> want to compile.
>
> The documentation here says string::shrink_to_fit() is a C++11 routine.
> http://www.cplusplus.com/reference/string/string/shrink_to_fit/
>
> I wonder if we're missing an option or something like that in our
> installation.  This is a V7R3 box.
>
> #include <iostream>
> #include <string>
>
> int main ()
> {
>   std::string str (100,'x');
>   std::cout << "1. capacity of str: " << str.capacity() << '\n';
>
>   str.resize(10);
>   std::cout << "2. capacity of str: " << str.capacity() << '\n';
>
>   str.shrink_to_fit();
>   std::cout << "3. capacity of str: " << str.capacity() << '\n';
>
>   return 0;
> }
>
> This gives me "The compilation failed.".  The listing says "shrink_to_fit
()
> is not a member of class ...."
> CRTBNDCPP PGM(BEAK/SHRINK) SRCSTMF('/home/beak/shrink_to_fit.cpp')
> OUTPUT(*print) LANGLVL(*EXTENDED0X)
>
> Is the compiler not fully C++11 compliant?
>
>
> On Fri, Feb 3, 2017 at 12:09 PM, Justin Taylor <[email protected]>
wrote:
>
> > My question was what compiler level I had, specifically looking for C++
> > 11.  I'm a "greenhorn" C++ dev, so maybe I missed it, but I don't see
> > anything in the 7.1 version of your link that answers that.
> >
> >
> >
> > -----Original Message-----
> > From: Aaron Albertson [mailto:albertaa-r/[email protected]]
> > Sent: Friday, February 03, 2017 11:19 AM
> > To: Bare Metal Programming IBM i (AS/400 and iSeries)
<c400-l-Zwy7GipZuJhWk0Htik3J/[email protected]
> > >
> > Subject: Re: [C400-L] V7R3 C++ questions
> >
> >
> > Hi all,
> >
> >         The supported language extensions for the C and C++ compiler
are
> > documented in the IBM i Knowledge Center.  Here is a link to the v7r3
> > version of this documentation:
> > https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/
> > rzarg/aix_cpp_extensions.htm
> > .
> >
> >         The compiler developers are adding new features every release.
I
> > was once a member of this team, and when I was part of the team there
were
> > three primary criteria for what features were added:
> >
> >    Low hanging fruit (features which are trivial to support)
> >    Features which the compiler team believes will be used by customers
(the
> >    compiler team usually has to guess here)
> >    Features requested by customers (these are given the highest
priority)
> >
> > I believe this is still the general philosophy of the team.  I know
that
> > the compiler team does have members that occasionally visit this forum,
so
> > I would recommend posting details on exactly what you are missing.  It
will
> > help the compiler team bump that functionality up their priority list,
and
> > it is also possible that you've discovered a bug in a feature that is
> > supposed to be working.
> >
> > If there is a feature that you feel is particularly important I would
> > recommend submitting a request for enhancement (RFE) (or upvoting an
> > existing request if one already exists for the feature you would like
to
> > see).  This is probably the best way to make sure that IBM knows you
care
> > about a particular issue.  Susan Gartner recently wrote a very nice
article
> > on The Four Hundred about how to submit an RFE:
> > https://www.itjungle.com/2017/01/30/guru-got-great-idea-tell-ibm/.  The
> > article is focused on submitting a request for RPG, but to do the same
> > thing for C/C++ you just need to specify "Languages - Other" instead of
> > "Languages - RPG" for the component.
> >
> > Thanks,
> >
> > Aaron Albertson
> >
> >
> > --
> > This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L)
> > mailing list
> > To post a message email: C400-L-Zwy7GipZuJhWk0Htik3J/[email protected]
> > To subscribe, unsubscribe, or change list options,
> > visit: http://lists.midrange.com/mailman/listinfo/c400-l
> > or email: C400-L-request-Zwy7GipZuJhWk0Htik3J/[email protected]
> > Before posting, please take a moment to review the archives
> > at http://archive.midrange.com/c400-l.
> >
> >
>
>
> --
> Kelly Beard
> --
> This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-
> L) mailing list
> To post a message email: C400-L-Zwy7GipZuJhWk0Htik3J/[email protected]
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/c400-l
> or email: C400-L-request-Zwy7GipZuJhWk0Htik3J/[email protected]
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/c400-l.
>
-- 
This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L) mailing list
To post a message email: C400-L-Zwy7GipZuJhWk0Htik3J/[email protected]
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request-Zwy7GipZuJhWk0Htik3J/[email protected]
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.