Thread: binders and negator

  1. #1
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446

    binders and negator

    Just to establish something quickly here...

    I definitely cannot use function adaptors to alter the interface to regular predicate functions. Only if my predicate function is a function object. Correct?
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >Correct?
    Sort of. You can do it by using ptr_fun, mem_fun, and friends. But technically, implementation-wise you can't because even the interfaces provided will wrap your function within a function object for actual use by the adapter.
    My best code is written with the delete key.

  3. #3
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Ok. Thanks Prelude. I was having an hard time interpreting the compiler errors. I was unsure if my design of the unary pred was flawed or if it had to do with the expected parameters to bind2nd(). Had to check.

    A function object solved my problem and even removed the need for the adaptor.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

Popular pages Recent additions subscribe to a feed