buggins / hibernated

HibernateD is ORM for D language (similar to Hibernate)
82 stars 31 forks source link

Fixed issue #60: (Deprecation: std.exception.enforceEx) #62

Closed TheWeirdDev closed 5 years ago

TheWeirdDev commented 5 years ago

Fixes an issue about the enforceEx Deprecation. enforceEx will be removed with 2.089

SingingBush commented 5 years ago

For backwards compatibility it may be worth doing something like:

static if(__VERSION__ < 2080) {
    // use enforceEx
} else {
    //use enforce on 2.080 and above
}

Seems like 2.080 was the point that changed: https://dlang.org/changelog/2.080.0.html

TheWeirdDev commented 5 years ago

Can we use an alias helper for this? something like:

static if(__VERSION__ < 2080) {
    alias enforceHelper = enforceEx;
} else {
    alias enforceHelper = enforce;
}

and replace all enforceEx usages with enforceHelper?