× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.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 <JUSTIN@xxxxxxxxxxxxx> 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@xxxxxxxxxx]
Sent: Friday, February 03, 2017 11:19 AM
To: Bare Metal Programming IBM i (AS/400 and iSeries) <c400-l@xxxxxxxxxxxx

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@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.