- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Whats wrong with this code
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-11-2008 06:57 AM
тАО12-11-2008 06:57 AM
!_stat_values.insert(
pair
static_cast
1L ) ).second )
{
_stat_values[ ( layout * 100 ) + ( file_in.get_data()[2] - '0' ) ]++;
}
Error that I am getting in aCC 6 is
"file_line_proc.cpp", line 768: error #2020: identifier "_stat_values" is
undefined
!_stat_values.insert(
^
BTW this code is working aCC 3...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-11-2008 07:08 AM
тАО12-11-2008 07:08 AM
Re: Whats wrong with this code
Anyway now i got another error
"/opt/aCC/include_std/memory", line 278: error #2403: invalid redeclaration of
member function "std::allocator<_TypeT>::address(_TypeT &) const
[with _TypeT=const long]" (declared at line 274)
const_pointer address (const_reference __x) const {
^
detected during:
instantiation of class
"std::allocator<_TypeT> [with _TypeT=const long]" at
line 88 of "/opt/aCC/include_std/rw/tree"
instantiation of class "__rw::__rw_rb_tree_node<_Alloc, _Val,
_Key, _KeyOf> [with
_Alloc=std::allocator<:pair>>,
_Val=std::pair
_KeyOf=__rw::__select1st<:pair>,
const long>]" at line 282 of
"/opt/aCC/include_std/rw/tree"
instantiation of class "__rw::__rb_tree<_Key, _Val, _KeyOf, _Comp,
_Alloc> [with _Key=const long, _Val=std::pair
_Alloc=std::allocator<:pair>>]" at
line 102 of "/opt/aCC/include_std/map"
instantiation of class "std::map<_Key, _TypeT, _Compare,
_Allocator> [with _Key=const long, _TypeT=long,
_Compare=std::less
_Allocator=std::allocator<:pair>>]"
at line 69 of
"../../../lib/process_data/inc/file_line_proc.h"
I know the shared files r working as they r used by other application I think...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-11-2008 07:10 AM
тАО12-11-2008 07:10 AM
Re: Whats wrong with this code
instantiation of class "std::map<_Key, _TypeT, _Compare,
_Allocator> [with _Key=const long, _TypeT=long,
_Compare=std::less
_Allocator=std::allocator<:pair>>]"
at line 69 of
"../../../lib/process_data/inc/file_line_proc.h"
- Tags:
- containers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-11-2008 07:04 PM
тАО12-11-2008 07:04 PM
SolutionThis old compiler doesn't meet the Standard. If you are porting to aCC6, you should read the "aC++ standard conformance and compatibility changes":
http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801/?ciid=2708d7c682f02110d7c682f02110275d6e10RCRD
Your problem is: ISO-39. aCC6 detects instantiation conflicts earlier (2403)
http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801/?ciid=2708d7c682f02110d7c682f02110275d6e10RCRD#_iso-39._acc6_detects_instantiation_
You have several problems:
_stat_values.insert(pair
You should never directly use pair or make_pair when you want to use maps. You should never use "const T" in a cast or function type, since top level CV qualifiers are ignored.
What you should do is:
typedef std::map
mapLL _stat_values;
_stat_values.insert(mapLL::value_type(layout,1L))
Your real problem is you can't use "const long" as a key in a map:
error #2403: invalid redeclaration of member function "std::allocator::address() const [with _TypeT=const long]"
>so this is where it must be doing something wrong
instantiation of class "std::map<_Key, _TypeT> [with _Key=const long, _TypeT=long,
at line 69 of file_line_proc.h
Right, remove that illegal "const".
- Tags:
- migration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-12-2008 05:16 AM
тАО12-12-2008 05:16 AM