Re: map/multimap/wildcards

Tech-Archive recommends: Fix windows errors by optimizing your registry



Igor Tandetnik wrote:
You can't. But for your problem, you don't need to. lower_bound(x) will
give you the lexicographically smallest string greater than or equal to
x. Under your comparison predicate, that would be the smallest string
whose prefix is x (if such exists). Once you found the place, you can
double-check with strcmpn.

Right, I get how it would work assuming the map is populated correctly.
But how would it manage to order the elements correctly to start with?

Maybe I'm missing something... or does this require the following
"clever" assumptions which might be true:

a) map<>s and multimap<>s determine equality by calling compare<a,b>
and compare<b,a> & seeing if they're both false
b) if f(a,b) = strncmp(a,b,length(b))<0 then f(a,b) and f(b,a) are
both false (I think) only if a and b are identical strings

.



Relevant Pages

  • bugs in .NETCF SP2
    ... XmlDocument.CreateNode(XmlNodeType, String, String) specifying a ... namespace as third parameter creating an element node will set the ... automatically a prefix in the XmlNode.OuterXml property. ... OuterXml property just uses the localname without prefix. ...
    (microsoft.public.dotnet.framework.compactframework)
  • bugs in .NET compact framework
    ... XmlDocument.CreateNode(XmlNodeType, String, String) specifying a ... namespace as third parameter creating an element node will set the ... automatically a prefix in the XmlNode.OuterXml property. ... OuterXml property just uses the localname without prefix. ...
    (microsoft.public.pocketpc.developer)
  • Re: treeView key change tracking
    ... I think this is why I can not figure out how to capture the prefix that has been assigned at any particular level. ... (becuase it is a recursive recordset, I can not assign levels ie. acct, master, invoice) ... nodParent) for a part that has children, ... Sub AddBranch(rs As Recordset, strPointerField As String, _ ...
    (microsoft.public.access.modulesdaovba)
  • Re: Macro for Changing Files Names
    ... The code for a folder browser is at ... Dim OldName As String, NewName As String ... Dim Prefix As String ...
    (microsoft.public.word.vba.general)
  • Re: [OT]Another n00b: Removing the space in "print text, var"
    ... Instead, the prefix was to indicate the function of the variable, not its datatype. ... indicator of a string class, ... what is this 'str' prefix supposed to mean? ... In a dynamic language, that variance could easily happen, which appears to be the basis for your "even *more* evil" comment. ...
    (comp.lang.python)