🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #1843

Re: STL map and pair classes

#1843
From: Jason Merrill
Date: Fri, 25 Aug 1995 06:11
20 lines
1303 bytes
Distribution:
>>>>> Michael Rice <mpr@absoft.com> writes:

> "tree.h", line 56.1: 1540-222: (S) "rb_tree<char,pair<const char,int>,select1st<pair<const char,int>,char>,less<char> >::rb_tree_node" needs a constructor because class member "value_field" needs a constructor initializer.
> "mm.C", line 14.1: 1540-207: (I) The previous message applies to the definition of template "map<char,int,less<char> >".

> The error seems reasonable to me, and goes away if pair has a default
> constructor.

No, it isn't reasonable, because rb_tree_node is an aggregate.  As such, it
can be initialized with a bracketed initializer list instead of a
constructor.

Jason


---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID: <MATT.95Aug24221130@Austern>
Path: arc1-ca.pugleaf.net!howland.reston.ans.net!agate!agate!Matt
References: <MATT.95Aug24132601@physics2.Berkeley.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!howland.reston.ans.net!agate!agate!Matt
From: jason@cygnus.com (Jason Merrill)
Newsgroups: comp.std.c++
Subject: Re: STL map and pair classes
Date: 25 Aug 1995 06:11:29 GMT
Organization: Cygnus Support, Mountain View, CA
Approved: Matt@Austern
Message-ID: <MATT.95Aug24221130@Austern>
References: <MATT.95Aug24132601@physics2.Berkeley.EDU>
NNTP-Posting-Host: austern.hip.berkeley.edu