Ignore:
Timestamp:
Sep 1, 2017, 4:26:14 PM (4 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
5809461, ba2a68b
Parents:
78a0b88
Message:

Handle user-defined literals in OperatorTable?, 0/1 from operator table

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Common/utility.h

    r78a0b88 rbc3127d  
    222222        std::cerr << "Warning: ";
    223223        warn_single( params... );
     224}
     225
     226/// determines if `pref` is a prefix of `str`
     227static inline bool isPrefix( const std::string & str, const std::string & pref ) {
     228        if ( pref.size() > str.size() ) return false;
     229        auto its = std::mismatch( pref.begin(), pref.end(), str.begin() );
     230        return its.first == pref.end();
    224231}
    225232
Note: See TracChangeset for help on using the changeset viewer.