Question about basic_string::find

Hello! I'm looking at the 2003 standard in section 21.3.6.1 on 
basic_string::find. The first method discussed there allows one to 
search a string for another string. It says that it returns a value, 
xpos, such that 

    at(xpos + I) == str.at(I) for all elements I of the string 
controlled by str.

In this situation 'str' is the string given as an argument to find. 
However, in the "Notes" section the standard says "Uses traits::eq()". 
The use of traits::eq() makes sense. Otherwise, for example, building 
case insensitive strings by providing alternate traits wouldn't work as 
expected. However, shouldn't the earlier condition really be

    traits::eq( at(xpos + I), str.at(I) ) for all elements I of the 
string controlled by str.

There seems to be a contradition here. The method is supposed to use 
traits::eq() yet it returns a value based on applications of operator==. 
Is this a standard bug or am I misunderstanding something?

Peter

      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
0
Peter
8/23/2004 10:11:44 PM
comp.lang.c++.moderated 10708 articles. 0 followers. allnor (8507) is leader. Post Follow

0 Replies
235 Views

Similar Articles

[PageSpeed] 48
Reply:
Similar Artilces:

simple destructor question
Hi All, if I have a class that uses a STL list of pointers like: class SomeClass { private: list<OtherClass*> aList; --other stuff-- } If I just do aList.clear() in the destructor is that sufficient or do I have to do a delete on each pointer in the list? Thanks for your help Michael michael wrote: > Hi All, > > if I have a class that uses a STL list of pointers like: > > class SomeClass { > private: > list<OtherClass*> aList; > --other stuff-- > } > > If I just do aList.clear() in the destructor is that ...

X11 question
I downloaded X11 at Apple's website, but this is a rootless system and so when I run it I can't have, say, IceWM or Windowmaker manage the windows for me. Is there a version of X11 that comes in a package that would install as easily as Apple's version of X11, and one in which I could run whatever window manager I wanted? Thank you. -- GR Gaudreau <http://grgaud.exchristian.info> <grgaud at sympatico dot ca> On 2003-10-20, GRGAUD <look@bottom.post> wrote: > I downloaded X11 at Apple's website, but this is a rootless system and > so when I run it ...

selectOneMenu simple question...
Hi guys, i'm a question for you.I'm using for the first time a selectonemenu tag in my JSF application and i've this error javax.servlet.ServletException: javax.servlet.jsp.JspException: Value binding '#{user.teams}'of UISelectItems with component-path {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /Login.jsp][Class: javax.faces.component.html.HtmlForm,Id: _id1][Class: javax.faces.component.html.HtmlPanelGrid,Id: _id2][Class: javax.faces.component.html.HtmlPanelGrid,Id: _id4][Class: javax.faces.component.html.HtmlSelectOneMenu,Id: selectTeam][Class: jav...

Re: A DATASET QUESTION #2
Here is one solution data a ; input subject variableun $ 10-35; variableun=compress(variableun,';'); if INDEX(variableun,'ONGO') THEN VAR='A';ELSE VAR='B'; KEEP VAR; cards4; 1 City Bus leaving - ONGO; 2 Cneter city, california 3 City center colosed - ONGO 4 Center city working - ONGO; 5 Uptown Bronx, New York; 6 Mall center Closed ONGO ;;;; run; proc print; run; Nat Wooding Environmental Specialist III Dominion, Environmental Biology 4111 Castlewood Rd Richmond, VA 23234 Phone:804-271-5313, Fax: 804-...

Print
This works fine print "*" x 10; print "\n"; But is there a way to print *'s then a newline in one line print "*" x 10"\n"; doesnt work. Tks begin 666 cvidal.vcf M0D5'24XZ5D-!4D0-"E9%4E-)3TXZ,BXQ#0I..CMC=FED86P-"D9..F-V:61A M; T*14U!24P[4%)%1CM)3E1%4DY%5#IC=FED86Q 871T+F-O;0T*4D56.C(P ;,#,P.# X5#$S,3@R,%H-"D5.1#I60T%21 T* ` end >>>>> "Chris" == Chris Vidal <cvidal@att.com> writes: Chris> print "*" x 10"\n"; doesnt work. print "*" x 10, "\n"; ...

My question
Hello, Today many parallel applications that are disk bound and/or memory bound can not scale on multicore systems. The question is not how to add more and more cores to a multicore system, the problem is how to scalable and speed more the memory system and hardisk system to be able to scale many more applications that are disk or/and memory bound. Thank you, Amine Moulay Ramdane. ...

personal smtp server question
Hi, I would like to install my personal smtp server to protect my privacy. I suspect that my ISP has blocked this option. I have tried to telnet the smtp server of my office at port 25 and not success. Any other solution? Thanks ...

Question about pychecker and pylint
Hi, I wonder if pychecker projet is dead ? On pychecker home page (http://pychecker.sourceforge.net/), last version date from February 3, 2006 and their mailist contain spam messages only. Other tools like pychecker is pylint at (http://www.logilab.org/project/eid/857). This is a great tools and it's still active. However, it has issue : its web site, it is very incomprehensible. Do you have other pylint web site ? Thanks for your information. Stephane ...

Newbie : Cross Tab Question
I wanted to create a cross tab like the result below.I wanted to do it via code. The important thing is that the totals end up at the end. Also, the percentage represent the share of the total for that line. Item 1 Percentag 1 Item 2 Percent 2 Total Items Sold Customer A 6 items sold 60% 4 Items sold 40% 10 Items Sold Customer B 25 items sold 50% 50 Items sold 50% 100 Items Sold How can I do the above via code. ...

Various Questions
How many of you are using Solaris Resource Manager in a production environment? For those of who in cross-platforms, how many use AIX Workload Manager? Is anyone using ADR? Is it in connection with SRM (ie. trigger a DR when some SRM limit is hit for a period of time)? How many of you are using the SEToolkit? What do you like about it? What additional functionality would you like to see? Same questions for other performance tools - what do you like about the tool? What is missing? You can post responses here or directly to me (jar@teamquest.com). Thanks in advance, Joe Rich - TeamQ...

Questions, Questions, Questions -- Well, really only two
This newsgroup seemed distribution non-specific so here goes: 1. Many companies who want to use linux, want it for email and web service. These systems don't need xwindows, and, in fact, as I understand it, not installing it not only saves resources but reduces security risk. Is there anywhere freely available a how-to install various current distributions of linux using text only, and installing mail, web and domain name service that is fairly easy for the uninformed to follow? Especially helpful would be a debian install. 2. Does anyone know of an encyclopedia, preferrably text-b...

XML beginners question
Good day, I am new on this newsgroup. For a project I am asked to read a XML data file into memory structure (entity structure/values). My question: What do I need for this? Are packages for this, are there some links for tutorials/information about this? I am a beginner on this issue, so please give me a few key-words to search for. Regards, Mike > My question: What do I need for this? Are packages for this, are there > some links for tutorials/information about this? I am a beginner on this > issue, so please give me a few key-words to search for. http://java.sun.com/j2se...

JCE question
Having played a lot with encryption and signing on the MS (shhhh!) .NET platform I decided to play around with the Java Cryptography E(nvironment?). In JCE I have gotten around to make some encrypt/decrypt playground utility using PBEWithMD5AndTripleDES, yet I wonder, is that the same as DESede which can also be given as the encryption algorithm? Basically I want to develop an encryption utility that I fully understand but this PBE thing I don't. Yes, I need to use a passphrase to do the encryption but why can't I do that with just selecting DESede as the algorithm (that is Trip...

49g+ question
Peace to you all I want to ask you all, something about my hp 49g+: everytime i try to enter a simple calculate like: 2 * p (the pay sign, 3.14...) and then i press "Enter" i get: 2.*p ? each time i must use the "Eval" button to get a properly answer. i use the latest rom version in algebric mode. thanks, Dan. Hold right shift down and press and release ENTER then release the shift key, too That will change you into Approx. mode (instead of Exact) And in the header = changes to ~ in order to indicate your mode change Alternatively you can press [MODE] then |CA...

fmincon question #6
I'm working on an optimization problem, and I'm having trouble setting up the constraints properly. The function that I am minimizing takes two inputs. It calls a number of other functions, but in the end returns a scalar output. The two inputs to the function are constrained, and I know how to do that. However, there are variables inside the function that I am minimizing that I need to constrain. These internal variables are dependent upon the two inputs and so can't themselves be inputs to the function I am minimizing. How would I constrain these internal variables (if it i...

Some questions
1. I can't find any brief description of PL/I grammar. 2. Are some editors, that support PL/I? Or, at least, parse files? 3. Have some body experience with multithreading facility of VA PL/I? Any tricks? 4. I'd like to call some Fortran subroutines from VA PL/I program. What compiler/linker is preferable? 5. PL/I have a big story, but I can't find any sufficiently big collection of PL codes (especially numerical). On my look, for IBM and Multics it sould be a lot. May be somebody knows about such collection(-s)? MZN wrote: > 1. I can't find any brief description of P...

Epson 2200 refilling question
I'm getting mixed answers from ink suppliers on this--do the 2200 carts (T034..) contain sponges or not? Has anyone sawed one open to find out? One of the problems refillers have with recent Epson carts is that these newer sponges deteriorate or harden quickly, limiting the number of refills and also the amount of ink that can be re-introduced. The sponge problem does not exist for 3rd party cartidges intended for refilling. This could be seen as another attempt to thwart refilling (in addition to the chip). But I'd also heard that internal sponges and pigment-based inks w...

Optimization question
The way I decided to get rid of end-of-line characters in existing strings for my little word-wrap project was to Translate() both '0d'x and '0a'x to spaces and run the resulting string through Space(). (I planned on using Space() anyway, so it added little.) This lets me allow for instances where the string uses the *nix end-of-line. I have it written as follows: strng = Space(Translate(strng,' ','0d0a'x)) It got me thinking. I used to do this sort of thing as follows next, because I find it easier to read: strng = Translate(strng,' ','0d0a...

XmRendition, XmRendertable...have a question on this code?
Hello, I have been trying to make it so that I can color specific lines of text within my List scroll window under X-Designer and Motiff. I have found that I can use what is called a Rendertable that is loaded with defined Rendition elements. I have figured out how I can change the color of the text and even change the font within my program but for some reason I am not able to change indivdual lines to different font properties. Here is what I have: I have a "for" loop that reads in information from a settings file to fill in the list scroll window information. First we c...

Sar questions
Below is my sar output. How can we know that what caused the cpu to consume 100% CPU at all time? #sar 00:00:00 %usr %sys %wio %idle (-u) 01:00:00 25 75 0 0 02:00:00 25 75 0 0 03:00:00 24 76 0 0 04:00:00 24 76 0 0 05:00:00 24 76 0 0 06:00:00 24 76 0 0 .. .. (%idle = 0 all the time) #sar 1 5 23:30:19 %usr %sys %wio %idle (-u) 23:30:20 24 76 0 0 23:30:21 24 76 0 0 23:30:22 16 84 0 ...

Netstat question.
tcp 0 1 wonderland:33390 66.201.121.2:http SYN_SENT tcp 0 0 wonderland:33375 neotokyo:ssh TIME_WAIT udp 0 0 localhost:32782 localhost:32782 ESTABLISHED I see these addresses when I type 'netstat'. Is there a way to force a connection to close? For instance, I don't know what the third line is--it's new to my system logs; how can I close it? Thanks, Naota -- naSota@tPampabay.rAr.cMom - > (remove capital letters: SPAM) Naota <see@the.signature> wrote: > tcp 0 ...

PlotLegend Question
When I use PlotLegend the amount of space devoted to the line (red line, or whatever) in the legend is pretty small. In fact, when the line is dashed or dash-dotted, it is difficult to tell the difference. Any ideas? Thanks, Kevin Here is an example << PlotLegends` bs = {FontFamily -> "Arial", FontSize -> 14, FontWeight -> Bold}; SetOptions[Plot, Frame -> True, FrameStyle -> AbsoluteThickness[2], GridLines -> Automatic, PlotStyle -> {{Red, AbsoluteThickness[2]}, {Black, AbsoluteThickness[2]}, {Blue, Absolute...

Questions, questions & more questions
Hi all, As I've got rather a lot of questions to post I thought I'd better merge a few into one post. Appreciate these have probably been asked stacks of times but research on the net has not turned up the answers. What's the quickest solution for transferring files from a PC to an Falcon/TT? I'm going to look into networking my Atari kit but that's a little way off at the moment. Is the Backwards ST emulator program still available? Would love to play some of my old favourites such as Megalomania. I know that I could use a PC emulator but somehow that...

Simplescalar cache_access( ) question
Hello: This is a Simplescalar simulator code question. In SS 3.0, cache is accessed using a cache_access( ) function. In case of write hit, shouldn't the 'ready' variable of the cache block structure be changed to (now+hit_latency), when there are no outstanding misses? If we return hit_latency when there is a read hit, why does the same not apply on a write hit? Currently, ready is changed only in the cache miss section to a future cycle time equal to miss latency of that cache access. Thanks in advance to anyone commenting on this question. -Arun. ...

jacORB SSLIOP certificate question
Hi, I am new to SSL. I just wonder for the SSL to work, do both the client side and server side need to configure a certificate? Or only the server side needs to have a certificate since the client can use the public key from the server side. But if there is one certificate, can this work for the communication from server to client (i.e. two directions)? Thanks, Terry ...