Bind1st in plain C (cross-platform, thread-safe, re-enterable)

Discussion in 'C Programming' started by yury.schkatula@gmail.com, Dec 6, 2012.

  1. Guest

    Hi all,
    Few weeks ago I got a question in my head is it possible to make plain-C substitution for bind1st() algo from STL lib. I got some macros-based drafts working there but...
    1) they're ugly, you know
    2) they actually do for constants only (run-time values don't fit to my macros)
    3) best-candidate macro appears as GCC-specific (due nested functions)

    So finally I got understanding that such binders are not-implementable in plain ANSI C due statefull nature (keeping in mind the requirements for thread-safe and re-entrant implementation).

    Very thanks for your oppinions,
    Yury
     
    , Dec 6, 2012
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. wenmang
    Replies:
    1
    Views:
    675
    Victor Bazarov
    Aug 8, 2003
  2. Fred Ma
    Replies:
    2
    Views:
    2,321
    Fred Ma
    Feb 5, 2004
  3. Denis Remezov

    binary_function and bind1st

    Denis Remezov, May 19, 2004, in forum: C++
    Replies:
    6
    Views:
    1,008
    P.J. Plauger
    May 21, 2004
  4. Marc
    Replies:
    6
    Views:
    903
    Denis Remezov
    Jul 6, 2004
  5. John Black
    Replies:
    3
    Views:
    596
    John Harrison
    Aug 8, 2004
  6. Alfonso Morra
    Replies:
    1
    Views:
    565
    Alfonso Morra
    Jul 18, 2005
  7. Gabriel Rossetti
    Replies:
    0
    Views:
    1,854
    Gabriel Rossetti
    Aug 29, 2008
  8. John Nagle
    Replies:
    5
    Views:
    771
    John Nagle
    Mar 12, 2012
Loading...