mirror of
https://github.com/dlang/phobos.git
synced 2025-04-29 22:50:38 +03:00
Fix template constraint of assumePureFunction
The constraint was actually a runtime `if`, leaving `assumePureFunction` without a `return` at the end of the function.
This commit is contained in:
parent
3ded2f5c50
commit
5b6507df1f
1 changed files with 3 additions and 5 deletions
|
@ -568,12 +568,10 @@ private auto defaultFactoryImpl(Char)(const ref Regex!Char re)
|
||||||
// Used to generate a pure wrapper for defaultFactoryImpl. Based on the example in
|
// Used to generate a pure wrapper for defaultFactoryImpl. Based on the example in
|
||||||
// the std.traits.SetFunctionAttributes documentation.
|
// the std.traits.SetFunctionAttributes documentation.
|
||||||
private auto assumePureFunction(T)(T t)
|
private auto assumePureFunction(T)(T t)
|
||||||
|
if (isFunctionPointer!T)
|
||||||
{
|
{
|
||||||
if (isFunctionPointer!T)
|
|
||||||
{
|
|
||||||
enum attrs = functionAttributes!T | FunctionAttribute.pure_;
|
enum attrs = functionAttributes!T | FunctionAttribute.pure_;
|
||||||
return cast(SetFunctionAttributes!(T, functionLinkage!T, attrs)) t;
|
return cast(SetFunctionAttributes!(T, functionLinkage!T, attrs)) t;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// A workaround for R-T enum re = regex(...)
|
// A workaround for R-T enum re = regex(...)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue