Re: V7R3 C++ questions
Kelly Beard <[email protected]>
| Newsgroups | gmane.comp.lang.as400.c |
|---|---|
| Message-ID | <CAOvM2Svc1YXcSsJMprBrrASFwAxc=3VfXBUkgqsi0nZP4TRUKQ@mail.gmail.com> |
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.