Goose  Diff

Differences From Artifact [b2dd48f951]:

  • File bs/util/stringid.h — part of check-in [d5bc4daeca] at 2019-08-20 23:42:39 on branch trunk —
    • Fixed broken canBeExecuted() and canBeEagerlyEvaluated() computation of CFGs.
    • Added some error messages when a function with compile-time only types contains calls to runtime functions. (to be improved and detected during parsing rather than codegen but serviceable for now)
    (user: achavasse size: 2230)

To Artifact [577fa923b8]:

  • File bs/util/stringid.h — part of check-in [af650a9e95] at 2019-09-22 14:37:55 on branch trunk — Project renaming. (user: achavasse size: 2218)

1
2
3
4
5
6
7
8
9
10
11
#ifndef EMPATHY_UTIL_STRINGID_H
#define EMPATHY_UTIL_STRINGID_H

namespace empathy::util
{
    class StringId
    {
        public:
            StringId() {}
            explicit StringId( const string& str );
            explicit StringId( string&& str );
|
|

|







1
2
3
4
5
6
7
8
9
10
11
#ifndef GOOSE_UTIL_STRINGID_H
#define GOOSE_UTIL_STRINGID_H

namespace goose::util
{
    class StringId
    {
        public:
            StringId() {}
            explicit StringId( const string& str );
            explicit StringId( string&& str );
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
            const string* m_pString = nullptr;
            static unordered_set< string > m_strings;
    };
}

namespace std
{
    template<> struct hash< empathy::util::StringId >
    {
        size_t operator()( const empathy::util::StringId& x ) const
        {
            return hash< const char* >()( x.c_str() );
        }
    };
}

static inline auto operator "" _sid( const char* pString, std::size_t s )
{
    return empathy::util::StringId( pString, s );
}

#endif







|

|








|



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
            const string* m_pString = nullptr;
            static unordered_set< string > m_strings;
    };
}

namespace std
{
    template<> struct hash< goose::util::StringId >
    {
        size_t operator()( const goose::util::StringId& x ) const
        {
            return hash< const char* >()( x.c_str() );
        }
    };
}

static inline auto operator "" _sid( const char* pString, std::size_t s )
{
    return goose::util::StringId( pString, s );
}

#endif