";
* $(WEB archjava.fluid.cs.cmu.edu/papers/oopsla02.pdf, ArchJava)
* language.
*
- * The downside of using $(D assumeUnique)'s
+ * The downside of using `assumeUnique`'s
* convention-based usage is that at this time there is no
* formal checking of the correctness of the assumption;
- * on the upside, the idiomatic use of $(D assumeUnique) is
+ * on the upside, the idiomatic use of `assumeUnique` is
* simple and rare enough to be tolerable.
*
*/
@@ -892,17 +892,17 @@ version(none) unittest
}
/**
- * Wraps a possibly-throwing expression in a $(D nothrow) wrapper so that it
- * can be called by a $(D nothrow) function.
+ * Wraps a possibly-throwing expression in a `nothrow` wrapper so that it
+ * can be called by a `nothrow` function.
*
* This wrapper function documents commitment on the part of the caller that
* the appropriate steps have been taken to avoid whatever conditions may
- * trigger an exception during the evaluation of $(D expr). If it turns out
+ * trigger an exception during the evaluation of `expr`. If it turns out
* that the expression $(I does) throw at runtime, the wrapper will throw an
- * $(D AssertError).
+ * `AssertError`.
*
- * (Note that $(D Throwable) objects such as $(D AssertError) that do not
- * subclass $(D Exception) may be thrown even from $(D nothrow) functions,
+ * (Note that `Throwable` objects such as `AssertError` that do not
+ * subclass `Exception` may be thrown even from `nothrow` functions,
* since they are considered to be serious runtime problems that cannot be
* recovered from.)
*/
@@ -967,34 +967,34 @@ unittest
}
/**
-The "pointsTo" functions, $(D doesPointTo) and $(D mayPointTo).
+The "pointsTo" functions, `doesPointTo` and `mayPointTo`.
-Returns $(D true) if $(D source)'s representation embeds a pointer
-that points to $(D target)'s representation or somewhere inside
+Returns `true` if `source`'s representation embeds a pointer
+that points to `target`'s representation or somewhere inside
it.
-If $(D source) is or contains a dynamic array, then, then these functions will check
-if there is overlap between the dynamic array and $(D target)'s representation.
+If `source` is or contains a dynamic array, then, then these functions will check
+if there is overlap between the dynamic array and `target`'s representation.
-If $(D source) is a class, then pointsTo will handle it as a pointer.
+If `source` is a class, then pointsTo will handle it as a pointer.
-If $(D target) is a pointer, a dynamic array or a class, then these functions will only
-check if $(D source) points to $(D target), $(I not) what $(D target) references.
+If `target` is a pointer, a dynamic array or a class, then these functions will only
+check if `source` points to `target`, $(I not) what `target` references.
-If $(D source) is or contains a union, then there may be either false positives or
+If `source` is or contains a union, then there may be either false positives or
false negatives:
-$(D doesPointTo) will return $(D true) if it is absolutely certain
-$(D source) points to $(D target). It may produce false negatives, but never
+`doesPointTo` will return `true` if it is absolutely certain
+`source` points to `target`. It may produce false negatives, but never
false positives. This function should be prefered when trying to validate
input data.
-$(D mayPointTo) will return $(D false) if it is absolutely certain
-$(D source) does not point to $(D target). It may produce false positives, but never
+`mayPointTo` will return `false` if it is absolutely certain
+`source` does not point to `target`. It may produce false positives, but never
false negatives. This function should be prefered for defensively choosing a
code path.
-Note: Evaluating $(D pointsTo(x, x)) checks whether $(D x) has
+Note: Evaluating $(D pointsTo(x, x)) checks whether `x` has
internal pointers. This should only be done as an assertive test,
as the language is free to assume objects don't have internal pointers
(TDPL 7.1.3.5).
@@ -1082,7 +1082,7 @@ deprecated ("pointsTo is ambiguous. Please use either of doesPointTo or mayPoint
alias pointsTo = doesPointTo;
/+
-Returns true if the field at index $(D i) in ($D T) shares its address with another field.
+Returns true if the field at index `i` in ($D T) shares its address with another field.
Note: This does not merelly check if the field is a member of an union, but also that
it is not a single child.
@@ -1409,7 +1409,7 @@ unittest //more alias this opCast
}
/*********************
- * Thrown if errors that set $(D errno) occur.
+ * Thrown if errors that set `errno` occur.
*/
class ErrnoException : Exception
{
@@ -1433,12 +1433,12 @@ class ErrnoException : Exception
/++
ML-style functional exception handling. Runs the supplied expression and
- returns its result. If the expression throws a $(D Throwable), runs the
+ returns its result. If the expression throws a `Throwable`, runs the
supplied error handler instead and return its result. The error handler's
type must be the same as the expression's type.
Params:
- E = The type of $(D Throwable)s to catch. Defaults to $(D Exception)
+ E = The type of `Throwable`s to catch. Defaults to `Exception`
T1 = The type of the expression.
T2 = The return type of the error handler.
expression = The expression to run and return its result.
@@ -1615,8 +1615,8 @@ version(unittest) package
cast(void)dg();
}
-/** This $(D enum) is used to select the methods of the range to handle by the
- $(D handle) range wrapper. The values of the $(D enum) can be OR'd to
+/** This `enum` is used to select the methods of the range to handle by the
+ `handle` range wrapper. The values of the `enum` can be OR'd to
selected multiple primitives to be handled.
*/
enum RangePrimitive
@@ -1636,27 +1636,27 @@ enum RangePrimitive
/** This range handles exceptions originating in ranges.
To use the range the code has to specify what methods of the range should be
-handled. This is done by use of the $(LREF $(D RangePrimitive)) enum. Multiple
+handled. This is done by use of the $(LREF `RangePrimitive`) enum. Multiple
methods of a range can be handled at once, by using the or operator two
-combine multiple $(D RangePrimitive). If more than one method should be
+combine multiple `RangePrimitive`. If more than one method should be
handled by one user supplied handler, all methods must have the same sigature.
-The $(D handler) $(D alias) must takes a $(D Throwable) as first of type $(D
-R) as first argument a range of type $(D IRange) as second argument. The
-return type of the $(D alias) must be equal to the return type of the
+The `handler` `alias` must takes a `Throwable` as first of type $(D
+R) as first argument a range of type `IRange` as second argument. The
+return type of the `alias` must be equal to the return type of the
primitive handled.
Params:
E = The type of Throwable to handle.
- functionsToHandle = The $(D RangePrimitive) selecting which primitives to
+ functionsToHandle = The `RangePrimitive` selecting which primitives to
handle.
handler = The callable that is called when a handled primitive throw an
- $(D Throwable) of type $(D E). The handler must have the same return type
+ `Throwable` of type `E`. The handler must have the same return type
as the handled primitive and must accepect parameters of the $(D E, ref
IRange).
input = The range to handle.
-Returns: A wrapper $(D struct) that preserves the $(D range) interface of the
+Returns: A wrapper `struct` that preserves the `range` interface of the
passed $(D IRange input).
*/
auto handle(E : Throwable, RangePrimitive functionsToHandle, alias handler, IRange)(IRange input)
diff --git a/std/experimental/logger/core.d b/std/experimental/logger/core.d
index e5f71cb384c..b3cf1f3fe88 100644
--- a/std/experimental/logger/core.d
+++ b/std/experimental/logger/core.d
@@ -20,9 +20,9 @@ shared static this()
stdSharedLoggerMutex = new Mutex;
}
-/** This template evaluates if the passed $(D LogLevel) is active.
+/** This template evaluates if the passed `LogLevel` is active.
The previously described version statements are used to decide if the
-$(D LogLevel) is active. The version statements only influence the compile
+`LogLevel` is active. The version statements only influence the compile
unit they are used with, therefore this function can only disable logging this
specific compile unit.
*/
@@ -67,10 +67,10 @@ template isLoggingActiveAt(LogLevel ll)
}
}
-/// This compile-time flag is $(D true) if logging is not statically disabled.
+/// This compile-time flag is `true` if logging is not statically disabled.
enum isLoggingActive = isLoggingActiveAt!(LogLevel.all);
-/** This functions is used at runtime to determine if a $(D LogLevel) is
+/** This functions is used at runtime to determine if a `LogLevel` is
active. The same previously defined version statements are used to disable
certain levels. Again the version statements are associated with a compile
unit and can therefore not disable logging in other compile units.
@@ -106,19 +106,19 @@ bool isLoggingEnabled()(LogLevel ll, LogLevel loggerLL,
&& condition;
}
-/** This template returns the $(D LogLevel) named "logLevel" of type $(D
+/** This template returns the `LogLevel` named "logLevel" of type $(D
LogLevel) defined in a user defined module where the filename has the
-suffix "_loggerconfig.d". This $(D LogLevel) sets the minimal $(D LogLevel)
+suffix "_loggerconfig.d". This `LogLevel` sets the minimal `LogLevel`
of the module.
-A minimal $(D LogLevel) can be defined on a per module basis.
-In order to define a module $(D LogLevel) a file with a modulename
+A minimal `LogLevel` can be defined on a per module basis.
+In order to define a module `LogLevel` a file with a modulename
"MODULENAME_loggerconfig" must be found. If no such module exists and the
module is a nested module, it is checked if there exists a
"PARENT_MODULE_loggerconfig" module with such a symbol.
-If this module exists and it contains a $(D LogLevel) called logLevel this $(D
+If this module exists and it contains a `LogLevel` called logLevel this $(D
LogLevel) will be used. This parent lookup is continued until there is no
-parent module. Then the moduleLogLevel is $(D LogLevel.all).
+parent module. Then the moduleLogLevel is `LogLevel.all`.
*/
template moduleLogLevel(string moduleName) if (!moduleName.length)
{
@@ -164,9 +164,9 @@ private string parentOf(string mod)
return null;
}
-/* This function formates a $(D SysTime) into an $(D OutputRange).
+/* This function formates a `SysTime` into an `OutputRange`.
-The $(D SysTime) is formatted similar to
+The `SysTime` is formatted similar to
$(LREF std.datatime.DateTime.toISOExtString) expect the fractional second part.
The sub second part is the upper three digest of the microsecond.
*/
@@ -182,13 +182,13 @@ void systimeToISOString(OutputRange)(OutputRange o, const ref SysTime time)
/** This function logs data.
-In order for the data to be processed the $(D LogLevel) of the log call must
-be greater or equal to the $(D LogLevel) of the $(D sharedLog) and the
-$(D defaultLogLevel) additionally the condition passed must be $(D true).
+In order for the data to be processed the `LogLevel` of the log call must
+be greater or equal to the `LogLevel` of the `sharedLog` and the
+`defaultLogLevel` additionally the condition passed must be `true`.
Params:
- ll = The $(D LogLevel) used by this log call.
- condition = The condition must be $(D true) for the data to be logged.
+ ll = The `LogLevel` used by this log call.
+ condition = The condition must be `true` for the data to be logged.
args = The data that should be logged.
Examples:
@@ -229,11 +229,11 @@ void log(T, string moduleName = __MODULE__)(const LogLevel ll,
/** This function logs data.
-In order for the data to be processed the $(D LogLevel) of the log call must
-be greater or equal to the $(D LogLevel) of the $(D sharedLog).
+In order for the data to be processed the `LogLevel` of the log call must
+be greater or equal to the `LogLevel` of the `sharedLog`.
Params:
- ll = The $(D LogLevel) used by this log call.
+ ll = The `LogLevel` used by this log call.
args = The data that should be logged.
Examples:
@@ -273,12 +273,12 @@ void log(T, string moduleName = __MODULE__)(const LogLevel ll, lazy T arg,
/** This function logs data.
-In order for the data to be processed the $(D LogLevel) of the
-$(D sharedLog) must be greater or equal to the $(D defaultLogLevel)
-add the condition passed must be $(D true).
+In order for the data to be processed the `LogLevel` of the
+`sharedLog` must be greater or equal to the `defaultLogLevel`
+add the condition passed must be `true`.
Params:
- condition = The condition must be $(D true) for the data to be logged.
+ condition = The condition must be `true` for the data to be logged.
args = The data that should be logged.
Examples:
@@ -312,8 +312,8 @@ void log(T, string moduleName = __MODULE__)(lazy bool condition, lazy T arg,
/** This function logs data.
-In order for the data to be processed the $(D LogLevel) of the
-$(D sharedLog) must be greater or equal to the $(D defaultLogLevel).
+In order for the data to be processed the `LogLevel` of the
+`sharedLog` must be greater or equal to the `defaultLogLevel`.
Params:
args = The data that should be logged.
@@ -347,16 +347,16 @@ void log(T)(lazy T arg, int line = __LINE__, string file = __FILE__,
}
}
-/** This function logs data in a $(D printf)-style manner.
+/** This function logs data in a `printf`-style manner.
-In order for the data to be processed the $(D LogLevel) of the log call must
-be greater or equal to the $(D LogLevel) of the $(D sharedLog) and the
-$(D defaultLogLevel) additionally the condition passed must be $(D true).
+In order for the data to be processed the `LogLevel` of the log call must
+be greater or equal to the `LogLevel` of the `sharedLog` and the
+`defaultLogLevel` additionally the condition passed must be `true`.
Params:
- ll = The $(D LogLevel) used by this log call.
- condition = The condition must be $(D true) for the data to be logged.
- msg = The $(D printf)-style string.
+ ll = The `LogLevel` used by this log call.
+ condition = The condition must be `true` for the data to be logged.
+ msg = The `printf`-style string.
args = The data that should be logged.
Examples:
@@ -380,15 +380,15 @@ void logf(int line = __LINE__, string file = __FILE__,
}
}
-/** This function logs data in a $(D printf)-style manner.
+/** This function logs data in a `printf`-style manner.
-In order for the data to be processed the $(D LogLevel) of the log call must
-be greater or equal to the $(D LogLevel) of the $(D sharedLog) and the
-$(D defaultLogLevel).
+In order for the data to be processed the `LogLevel` of the log call must
+be greater or equal to the `LogLevel` of the `sharedLog` and the
+`defaultLogLevel`.
Params:
- ll = The $(D LogLevel) used by this log call.
- msg = The $(D printf)-style string.
+ ll = The `LogLevel` used by this log call.
+ msg = The `printf`-style string.
args = The data that should be logged.
Examples:
@@ -411,15 +411,15 @@ void logf(int line = __LINE__, string file = __FILE__,
}
}
-/** This function logs data in a $(D printf)-style manner.
+/** This function logs data in a `printf`-style manner.
-In order for the data to be processed the $(D LogLevel) of the log call must
-be greater or equal to the $(D defaultLogLevel) additionally the condition
-passed must be $(D true).
+In order for the data to be processed the `LogLevel` of the log call must
+be greater or equal to the `defaultLogLevel` additionally the condition
+passed must be `true`.
Params:
- condition = The condition must be $(D true) for the data to be logged.
- msg = The $(D printf)-style string.
+ condition = The condition must be `true` for the data to be logged.
+ msg = The `printf`-style string.
args = The data that should be logged.
Examples:
@@ -439,13 +439,13 @@ void logf(int line = __LINE__, string file = __FILE__,
}
}
-/** This function logs data in a $(D printf)-style manner.
+/** This function logs data in a `printf`-style manner.
-In order for the data to be processed the $(D LogLevel) of the log call must
-be greater or equal to the $(D defaultLogLevel).
+In order for the data to be processed the `LogLevel` of the log call must
+be greater or equal to the `defaultLogLevel`.
Params:
- msg = The $(D printf)-style string.
+ msg = The `printf`-style string.
args = The data that should be logged.
Examples:
@@ -465,7 +465,7 @@ void logf(int line = __LINE__, string file = __FILE__,
}
}
-/** This template provides the global log functions with the $(D LogLevel)
+/** This template provides the global log functions with the `LogLevel`
is encoded in the function name.
The aliases following this template create the public names of these log
@@ -500,13 +500,13 @@ template defaultLogFunction(LogLevel ll)
}
}
-/** This function logs data to the $(D stdThreadLocalLog).
+/** This function logs data to the `stdThreadLocalLog`.
-In order for the resulting log message to be logged the $(D LogLevel) must
-be greater or equal than the $(D LogLevel) of the $(D stdThreadLocalLog) and
-must be greater or equal than the global $(D LogLevel).
-Additionally the $(D LogLevel) must be greater or equal than the $(D LogLevel)
-of the $(D stdSharedLogger).
+In order for the resulting log message to be logged the `LogLevel` must
+be greater or equal than the `LogLevel` of the `stdThreadLocalLog` and
+must be greater or equal than the global `LogLevel`.
+Additionally the `LogLevel` must be greater or equal than the `LogLevel`
+of the `stdSharedLogger`.
Params:
args = The data that should be logged.
@@ -520,18 +520,18 @@ critical(1337, "is number");
fatal(1337, "is number");
--------------------
-The second version of the function logs data to the $(D stdThreadLocalLog) depending
+The second version of the function logs data to the `stdThreadLocalLog` depending
on a condition.
-In order for the resulting log message to be logged the $(D LogLevel) must
-be greater or equal than the $(D LogLevel) of the $(D stdThreadLocalLog) and
-must be greater or equal than the global $(D LogLevel) additionally the
-condition passed must be $(D true).
-Additionally the $(D LogLevel) must be greater or equal than the $(D LogLevel)
-of the $(D stdSharedLogger).
+In order for the resulting log message to be logged the `LogLevel` must
+be greater or equal than the `LogLevel` of the `stdThreadLocalLog` and
+must be greater or equal than the global `LogLevel` additionally the
+condition passed must be `true`.
+Additionally the `LogLevel` must be greater or equal than the `LogLevel`
+of the `stdSharedLogger`.
Params:
- condition = The condition must be $(D true) for the data to be logged.
+ condition = The condition must be `true` for the data to be logged.
args = The data that should be logged.
Examples:
@@ -555,8 +555,8 @@ alias critical = defaultLogFunction!(LogLevel.critical);
/// Ditto
alias fatal = defaultLogFunction!(LogLevel.fatal);
-/** This template provides the global $(D printf)-style log functions with
-the $(D LogLevel) is encoded in the function name.
+/** This template provides the global `printf`-style log functions with
+the `LogLevel` is encoded in the function name.
The aliases following this template create the public names of the log
functions.
@@ -590,17 +590,17 @@ template defaultLogFunctionf(LogLevel ll)
}
}
-/** This function logs data to the $(D sharedLog) in a $(D printf)-style
+/** This function logs data to the `sharedLog` in a `printf`-style
manner.
-In order for the resulting log message to be logged the $(D LogLevel) must
-be greater or equal than the $(D LogLevel) of the $(D sharedLog) and
-must be greater or equal than the global $(D LogLevel).
-Additionally the $(D LogLevel) must be greater or equal than the $(D LogLevel)
-of the $(D stdSharedLogger).
+In order for the resulting log message to be logged the `LogLevel` must
+be greater or equal than the `LogLevel` of the `sharedLog` and
+must be greater or equal than the global `LogLevel`.
+Additionally the `LogLevel` must be greater or equal than the `LogLevel`
+of the `stdSharedLogger`.
Params:
- msg = The $(D printf)-style string.
+ msg = The `printf`-style string.
args = The data that should be logged.
Examples:
@@ -612,18 +612,18 @@ criticalf("is number %d", 4);
fatalf("is number %d", 5);
--------------------
-The second version of the function logs data to the $(D sharedLog) in a $(D
+The second version of the function logs data to the `sharedLog` in a $(D
printf)-style manner.
-In order for the resulting log message to be logged the $(D LogLevel) must
-be greater or equal than the $(D LogLevel) of the $(D sharedLog) and
-must be greater or equal than the global $(D LogLevel).
-Additionally the $(D LogLevel) must be greater or equal than the $(D LogLevel)
-of the $(D stdSharedLogger).
+In order for the resulting log message to be logged the `LogLevel` must
+be greater or equal than the `LogLevel` of the `sharedLog` and
+must be greater or equal than the global `LogLevel`.
+Additionally the `LogLevel` must be greater or equal than the `LogLevel`
+of the `stdSharedLogger`.
Params:
- condition = The condition must be $(D true) for the data to be logged.
- msg = The $(D printf)-style string.
+ condition = The condition must be `true` for the data to be logged.
+ msg = The `printf`-style string.
args = The data that should be logged.
Examples:
@@ -699,13 +699,13 @@ unittest
/**
There are eight usable logging level. These level are $(I all), $(I trace),
$(I info), $(I warning), $(I error), $(I critical), $(I fatal), and $(I off).
-If a log function with $(D LogLevel.fatal) is called the shutdown handler of
+If a log function with `LogLevel.fatal` is called the shutdown handler of
that logger is called.
*/
enum LogLevel : ubyte
{
- all = 1, /** Lowest possible assignable $(D LogLevel). */
- trace = 32, /** $(D LogLevel) for tracing the execution of the program. */
+ all = 1, /** Lowest possible assignable `LogLevel`. */
+ trace = 32, /** `LogLevel` for tracing the execution of the program. */
info = 64, /** This level is used to display information about the
program. */
warning = 96, /** warnings about the program should be displayed with this
@@ -716,15 +716,15 @@ enum LogLevel : ubyte
logged with this level. */
fatal = 192, /** Log messages that describe fatal errors should use this
level. */
- off = ubyte.max /** Highest possible $(D LogLevel). */
+ off = ubyte.max /** Highest possible `LogLevel`. */
}
/** This class is the base of every logger. In order to create a new kind of
-logger a deriving class needs to implement the $(D writeLogMsg) method. By
+logger a deriving class needs to implement the `writeLogMsg` method. By
default this is not thread-safe.
-It is also possible to $(D override) the three methods $(D beginLogMsg),
-$(D logMsgPart) and $(D finishLogMsg) together, this option gives more
+It is also possible to `override` the three methods `beginLogMsg`,
+`logMsgPart` and `finishLogMsg` together, this option gives more
flexibility.
*/
abstract class Logger
@@ -746,7 +746,7 @@ abstract class Logger
string prettyFuncName;
/// the name of the module the log message is coming from
string moduleName;
- /// the $(D LogLevel) associated with the log message
+ /// the `LogLevel` associated with the log message
LogLevel logLevel;
/// thread id of the log message
Tid threadId;
@@ -754,16 +754,16 @@ abstract class Logger
SysTime timestamp;
/// the message of the log message
string msg;
- /// A refernce to the $(D Logger) used to create this $(D LogEntry)
+ /// A refernce to the `Logger` used to create this `LogEntry`
Logger logger;
}
- /** This constructor takes a name of type $(D string), and a $(D LogLevel).
+ /** This constructor takes a name of type `string`, and a `LogLevel`.
- Every subclass of $(D Logger) has to call this constructor from there
- constructor. It sets the $(D LogLevel), the name of the $(D Logger), and
- creates a fatal handler. The fatal handler will throw an $(D Error) if a
- log call is made with a $(D LogLevel) $(D LogLevel.fatal).
+ Every subclass of `Logger` has to call this constructor from there
+ constructor. It sets the `LogLevel`, the name of the `Logger`, and
+ creates a fatal handler. The fatal handler will throw an `Error` if a
+ log call is made with a `LogLevel` `LogLevel.fatal`.
*/
this(LogLevel lv) @safe
{
@@ -776,7 +776,7 @@ abstract class Logger
}
/** A custom logger must implement this method in order to work in a
- $(D MultiLogger) and $(D ArrayLogger).
+ `MultiLogger` and `ArrayLogger`.
Params:
payload = All information associated with call to log function.
@@ -785,14 +785,14 @@ abstract class Logger
*/
abstract protected void writeLogMsg(ref LogEntry payload) @safe;
- /* The default implementation will use an $(D std.array.appender)
+ /* The default implementation will use an `std.array.appender`
internally to construct the message string. This means dynamic,
GC memory allocation. A logger can avoid this allocation by
- reimplementing $(D beginLogMsg), $(D logMsgPart) and $(D finishLogMsg).
- $(D beginLogMsg) is always called first, followed by any number of calls
- to $(D logMsgPart) and one call to $(D finishLogMsg).
+ reimplementing `beginLogMsg`, `logMsgPart` and `finishLogMsg`.
+ `beginLogMsg` is always called first, followed by any number of calls
+ to `logMsgPart` and one call to `finishLogMsg`.
- As an example for such a custom $(D Logger) compare this:
+ As an example for such a custom `Logger` compare this:
----------------
class CLogger : Logger
{
@@ -848,7 +848,7 @@ abstract class Logger
}
/** Signals that the message has been written and no more calls to
- $(D logMsgPart) follow. */
+ `logMsgPart` follow. */
protected void finishLogMsg() @safe
{
static if (isLoggingActive)
@@ -858,12 +858,12 @@ abstract class Logger
}
}
- /** The $(D LogLevel) determines if the log call are processed or dropped
- by the $(D Logger). In order for the log call to be processed the
- $(D LogLevel) of the log call must be greater or equal to the $(D LogLevel)
- of the $(D logger).
+ /** The `LogLevel` determines if the log call are processed or dropped
+ by the `Logger`. In order for the log call to be processed the
+ `LogLevel` of the log call must be greater or equal to the `LogLevel`
+ of the `logger`.
- These two methods set and get the $(D LogLevel) of the used $(D Logger).
+ These two methods set and get the `LogLevel` of the used `Logger`.
Example:
-----------
@@ -883,10 +883,10 @@ abstract class Logger
synchronized (mutex) this.logLevel_ = lv;
}
- /** This $(D delegate) is called in case a log message with
- $(D LogLevel.fatal) gets logged.
+ /** This `delegate` is called in case a log message with
+ `LogLevel.fatal` gets logged.
- By default an $(D Error) will be thrown.
+ By default an `Error` will be thrown.
*/
@property final void delegate() fatalHandler() const pure @safe @nogc
{
@@ -901,10 +901,10 @@ abstract class Logger
/** This method allows forwarding log entries from one logger to another.
- $(D forwardMsg) will ensure proper synchronization and then call
- $(D writeLogMsg). This is an API for implementing your own loggers and
+ `forwardMsg` will ensure proper synchronization and then call
+ `writeLogMsg`. This is an API for implementing your own loggers and
should not be called by normal user code. A notable difference from other
- logging functions is that the $(D globalLogLevel) wont be evaluated again
+ logging functions is that the `globalLogLevel` wont be evaluated again
since it is assumed that the caller already checked that.
*/
void forwardMsg(ref LogEntry payload) @trusted
@@ -928,8 +928,8 @@ abstract class Logger
}
}
- /** This template provides the log functions for the $(D Logger) $(D class)
- with the $(D LogLevel) encoded in the function name.
+ /** This template provides the log functions for the `Logger` `class`
+ with the `LogLevel` encoded in the function name.
For further information see the the two functions defined inside of this
template.
@@ -939,11 +939,11 @@ abstract class Logger
*/
template memLogFunctions(LogLevel ll)
{
- /** This function logs data to the used $(D Logger).
+ /** This function logs data to the used `Logger`.
- In order for the resulting log message to be logged the $(D LogLevel)
- must be greater or equal than the $(D LogLevel) of the used $(D Logger)
- and must be greater or equal than the global $(D LogLevel).
+ In order for the resulting log message to be logged the `LogLevel`
+ must be greater or equal than the `LogLevel` of the used `Logger`
+ and must be greater or equal than the global `LogLevel`.
Params:
args = The data that should be logged.
@@ -983,16 +983,16 @@ abstract class Logger
}
}
- /** This function logs data to the used $(D Logger) depending on a
+ /** This function logs data to the used `Logger` depending on a
condition.
- In order for the resulting log message to be logged the $(D LogLevel) must
- be greater or equal than the $(D LogLevel) of the used $(D Logger) and
- must be greater or equal than the global $(D LogLevel) additionally the
- condition passed must be $(D true).
+ In order for the resulting log message to be logged the `LogLevel` must
+ be greater or equal than the `LogLevel` of the used `Logger` and
+ must be greater or equal than the global `LogLevel` additionally the
+ condition passed must be `true`.
Params:
- condition = The condition must be $(D true) for the data to be logged.
+ condition = The condition must be `true` for the data to be logged.
args = The data that should be logged.
Examples:
@@ -1031,17 +1031,17 @@ abstract class Logger
}
}
- /** This function logs data to the used $(D Logger) in a
- $(D printf)-style manner.
+ /** This function logs data to the used `Logger` in a
+ `printf`-style manner.
- In order for the resulting log message to be logged the $(D LogLevel)
- must be greater or equal than the $(D LogLevel) of the used $(D Logger)
- and must be greater or equal than the global $(D LogLevel) additionally
- the passed condition must be $(D true).
+ In order for the resulting log message to be logged the `LogLevel`
+ must be greater or equal than the `LogLevel` of the used `Logger`
+ and must be greater or equal than the global `LogLevel` additionally
+ the passed condition must be `true`.
Params:
- condition = The condition must be $(D true) for the data to be logged.
- msg = The $(D printf)-style string.
+ condition = The condition must be `true` for the data to be logged.
+ msg = The `printf`-style string.
args = The data that should be logged.
Examples:
@@ -1080,15 +1080,15 @@ abstract class Logger
}
}
- /** This function logs data to the used $(D Logger) in a
- $(D printf)-style manner.
+ /** This function logs data to the used `Logger` in a
+ `printf`-style manner.
- In order for the resulting log message to be logged the $(D LogLevel) must
- be greater or equal than the $(D LogLevel) of the used $(D Logger) and
- must be greater or equal than the global $(D LogLevel).
+ In order for the resulting log message to be logged the `LogLevel` must
+ be greater or equal than the `LogLevel` of the used `Logger` and
+ must be greater or equal than the global `LogLevel`.
Params:
- msg = The $(D printf)-style string.
+ msg = The `printf`-style string.
args = The data that should be logged.
Examples:
@@ -1152,15 +1152,15 @@ abstract class Logger
/// Ditto
alias fatalf = memLogFunctions!(LogLevel.fatal).logImplf;
- /** This method logs data with the $(D LogLevel) of the used $(D Logger).
+ /** This method logs data with the `LogLevel` of the used `Logger`.
- This method takes a $(D bool) as first argument. In order for the
- data to be processed the $(D bool) must be $(D true) and the $(D LogLevel)
- of the Logger must be greater or equal to the global $(D LogLevel).
+ This method takes a `bool` as first argument. In order for the
+ data to be processed the `bool` must be `true` and the `LogLevel`
+ of the Logger must be greater or equal to the global `LogLevel`.
Params:
args = The data that should be logged.
- condition = The condition must be $(D true) for the data to be logged.
+ condition = The condition must be `true` for the data to be logged.
args = The data that is to be logged.
Returns: The logger used by the logging function as reference.
@@ -1220,15 +1220,15 @@ abstract class Logger
}
}
- /** This function logs data to the used $(D Logger) with a specific
- $(D LogLevel).
+ /** This function logs data to the used `Logger` with a specific
+ `LogLevel`.
- In order for the resulting log message to be logged the $(D LogLevel)
- must be greater or equal than the $(D LogLevel) of the used $(D Logger)
- and must be greater or equal than the global $(D LogLevel).
+ In order for the resulting log message to be logged the `LogLevel`
+ must be greater or equal than the `LogLevel` of the used `Logger`
+ and must be greater or equal than the global `LogLevel`.
Params:
- ll = The specific $(D LogLevel) used for logging the log message.
+ ll = The specific `LogLevel` used for logging the log message.
args = The data that should be logged.
Examples:
@@ -1289,16 +1289,16 @@ abstract class Logger
}
}
- /** This function logs data to the used $(D Logger) depending on a
- explicitly passed condition with the $(D LogLevel) of the used
- $(D Logger).
+ /** This function logs data to the used `Logger` depending on a
+ explicitly passed condition with the `LogLevel` of the used
+ `Logger`.
- In order for the resulting log message to be logged the $(D LogLevel)
- of the used $(D Logger) must be greater or equal than the global
- $(D LogLevel) and the condition must be $(D true).
+ In order for the resulting log message to be logged the `LogLevel`
+ of the used `Logger` must be greater or equal than the global
+ `LogLevel` and the condition must be `true`.
Params:
- condition = The condition must be $(D true) for the data to be logged.
+ condition = The condition must be `true` for the data to be logged.
args = The data that should be logged.
Examples:
@@ -1361,12 +1361,12 @@ abstract class Logger
}
}
- /** This function logs data to the used $(D Logger) with the $(D LogLevel)
- of the used $(D Logger).
+ /** This function logs data to the used `Logger` with the `LogLevel`
+ of the used `Logger`.
- In order for the resulting log message to be logged the $(D LogLevel)
- of the used $(D Logger) must be greater or equal than the global
- $(D LogLevel).
+ In order for the resulting log message to be logged the `LogLevel`
+ of the used `Logger` must be greater or equal than the global
+ `LogLevel`.
Params:
args = The data that should be logged.
@@ -1431,17 +1431,17 @@ abstract class Logger
}
}
- /** This function logs data to the used $(D Logger) with a specific
- $(D LogLevel) and depending on a condition in a $(D printf)-style manner.
+ /** This function logs data to the used `Logger` with a specific
+ `LogLevel` and depending on a condition in a `printf`-style manner.
- In order for the resulting log message to be logged the $(D LogLevel)
- must be greater or equal than the $(D LogLevel) of the used $(D Logger)
- and must be greater or equal than the global $(D LogLevel) and the
- condition must be $(D true).
+ In order for the resulting log message to be logged the `LogLevel`
+ must be greater or equal than the `LogLevel` of the used `Logger`
+ and must be greater or equal than the global `LogLevel` and the
+ condition must be `true`.
Params:
- ll = The specific $(D LogLevel) used for logging the log message.
- condition = The condition must be $(D true) for the data to be logged.
+ ll = The specific `LogLevel` used for logging the log message.
+ condition = The condition must be `true` for the data to be logged.
msg = The format string used for this log call.
args = The data that should be logged.
@@ -1479,15 +1479,15 @@ abstract class Logger
}
}
- /** This function logs data to the used $(D Logger) with a specific
- $(D LogLevel) in a $(D printf)-style manner.
+ /** This function logs data to the used `Logger` with a specific
+ `LogLevel` in a `printf`-style manner.
- In order for the resulting log message to be logged the $(D LogLevel)
- must be greater or equal than the $(D LogLevel) of the used $(D Logger)
- and must be greater or equal than the global $(D LogLevel).
+ In order for the resulting log message to be logged the `LogLevel`
+ must be greater or equal than the `LogLevel` of the used `Logger`
+ and must be greater or equal than the global `LogLevel`.
Params:
- ll = The specific $(D LogLevel) used for logging the log message.
+ ll = The specific `LogLevel` used for logging the log message.
msg = The format string used for this log call.
args = The data that should be logged.
@@ -1525,16 +1525,16 @@ abstract class Logger
}
}
- /** This function logs data to the used $(D Logger) depending on a
- condition with the $(D LogLevel) of the used $(D Logger) in a
- $(D printf)-style manner.
+ /** This function logs data to the used `Logger` depending on a
+ condition with the `LogLevel` of the used `Logger` in a
+ `printf`-style manner.
- In order for the resulting log message to be logged the $(D LogLevel)
- of the used $(D Logger) must be greater or equal than the global
- $(D LogLevel) and the condition must be $(D true).
+ In order for the resulting log message to be logged the `LogLevel`
+ of the used `Logger` must be greater or equal than the global
+ `LogLevel` and the condition must be `true`.
Params:
- condition = The condition must be $(D true) for the data to be logged.
+ condition = The condition must be `true` for the data to be logged.
msg = The format string used for this log call.
args = The data that should be logged.
@@ -1575,11 +1575,11 @@ abstract class Logger
}
}
- /** This method logs data to the used $(D Logger) with the $(D LogLevel)
- of the this $(D Logger) in a $(D printf)-style manner.
+ /** This method logs data to the used `Logger` with the `LogLevel`
+ of the this `Logger` in a `printf`-style manner.
- In order for the data to be processed the $(D LogLevel) of the $(D Logger)
- must be greater or equal to the global $(D LogLevel).
+ In order for the data to be processed the `LogLevel` of the `Logger`
+ must be greater or equal to the global `LogLevel`.
Params:
msg = The format string used for this log call.
@@ -1654,22 +1654,22 @@ private @property Logger defaultSharedLoggerImpl() @trusted
return stdSharedDefaultLogger;
}
-/** This property sets and gets the default $(D Logger).
+/** This property sets and gets the default `Logger`.
Example:
-------------
sharedLog = new FileLogger(yourFile);
-------------
-The example sets a new $(D FileLogger) as new $(D sharedLog).
+The example sets a new `FileLogger` as new `sharedLog`.
If at some point you want to use the original default logger again, you can
use $(D sharedLog = null;). This will put back the original.
Note:
-While getting and setting $(D sharedLog) is thread-safe, it has to be considered
+While getting and setting `sharedLog` is thread-safe, it has to be considered
that the returned reference is only a current snapshot and in the following
code, you must make sure no other thread reassigns to it between reading and
-writing $(D sharedLog).
+writing `sharedLog`.
-------------
if (sharedLog !is myLogger)
sharedLog = new myLogger;
@@ -1700,11 +1700,11 @@ if (sharedLog !is myLogger)
atomicStore!(MemoryOrder.rel)(stdSharedLogger, cast(shared) logger);
}
-/** This methods get and set the global $(D LogLevel).
+/** This methods get and set the global `LogLevel`.
-Every log message with a $(D LogLevel) lower as the global $(D LogLevel)
-will be discarded before it reaches $(D writeLogMessage) method of any
-$(D Logger).
+Every log message with a `LogLevel` lower as the global `LogLevel`
+will be discarded before it reaches `writeLogMessage` method of any
+`Logger`.
*/
/* Implementation note:
For any public logging call, the global log level shall only be queried once on
@@ -1724,18 +1724,18 @@ different levels at different spots in the code.
// Thread Local
-/** The $(D StdForwardLogger) will always forward anything to the sharedLog.
+/** The `StdForwardLogger` will always forward anything to the sharedLog.
-The $(D StdForwardLogger) will not throw if data is logged with $(D
+The `StdForwardLogger` will not throw if data is logged with $(D
LogLevel.fatal).
*/
class StdForwardLogger : Logger
{
- /** The default constructor for the $(D StdForwardLogger).
+ /** The default constructor for the `StdForwardLogger`.
Params:
- lv = The $(D LogLevel) for the $(D MultiLogger). By default the $(D
- LogLevel) is $(D all).
+ lv = The `LogLevel` for the `MultiLogger`. By default the $(D
+ LogLevel) is `all`.
*/
this(const LogLevel lv = LogLevel.all) @safe
{
@@ -1755,9 +1755,9 @@ class StdForwardLogger : Logger
auto nl1 = new StdForwardLogger(LogLevel.all);
}
-/** This $(D LogLevel) is unqiue to every thread.
+/** This `LogLevel` is unqiue to every thread.
-The thread local $(D Logger) will use this $(D LogLevel) to filter log calls
+The thread local `Logger` will use this `LogLevel` to filter log calls
every same way as presented earlier.
*/
//public LogLevel threadLogLevel = LogLevel.all;
@@ -1779,14 +1779,14 @@ private @property Logger stdThreadLocalLogImpl() @trusted
return stdLoggerDefaultThreadLogger;
}
-/** This function returns a thread unique $(D Logger), that by default
-propergates all data logged to it to the $(D sharedLog).
+/** This function returns a thread unique `Logger`, that by default
+propergates all data logged to it to the `sharedLog`.
-These properties can be used to set and get this $(D Logger). Every
-modification to this $(D Logger) will only be visible in the thread the
+These properties can be used to set and get this `Logger`. Every
+modification to this `Logger` will only be visible in the thread the
modification has been done from.
-This $(D Logger) is called by the free standing log functions. This allows to
+This `Logger` is called by the free standing log functions. This allows to
create thread local redirections and still use the free standing log
functions.
*/
diff --git a/std/experimental/logger/filelogger.d b/std/experimental/logger/filelogger.d
index 270e962f475..b678f3fcb00 100644
--- a/std/experimental/logger/filelogger.d
+++ b/std/experimental/logger/filelogger.d
@@ -3,7 +3,7 @@ module std.experimental.logger.filelogger;
import std.stdio;
import std.experimental.logger.core;
-/** This $(D Logger) implementation writes log messages to the associated
+/** This `Logger` implementation writes log messages to the associated
file. The name of the file has to be passed on construction time. If the file
is already present new log messages will be append at its end.
*/
@@ -13,13 +13,13 @@ class FileLogger : Logger
import std.datetime : SysTime;
import std.concurrency : Tid;
- /** A constructor for the $(D FileLogger) Logger.
+ /** A constructor for the `FileLogger` Logger.
Params:
- fn = The filename of the output file of the $(D FileLogger). If that
+ fn = The filename of the output file of the `FileLogger`. If that
file can not be opened for writting an exception will be thrown.
- lv = The $(D LogLevel) for the $(D FileLogger). By default the
- $(D LogLevel) for $(D FileLogger) is $(D LogLevel.info).
+ lv = The `LogLevel` for the `FileLogger`. By default the
+ `LogLevel` for `FileLogger` is `LogLevel.info`.
Example:
-------------
@@ -35,17 +35,17 @@ class FileLogger : Logger
this.file_.open(this.filename, "a");
}
- /** A constructor for the $(D FileLogger) Logger that takes a reference to
- a $(D File).
+ /** A constructor for the `FileLogger` Logger that takes a reference to
+ a `File`.
- The $(D File) passed must be open for all the log call to the
- $(D FileLogger). If the $(D File) gets closed, using the $(D FileLogger)
+ The `File` passed must be open for all the log call to the
+ `FileLogger`. If the `File` gets closed, using the `FileLogger`
for logging will result in undefined behaviour.
Params:
file = The file used for logging.
- lv = The $(D LogLevel) for the $(D FileLogger). By default the
- $(D LogLevel) for $(D FileLogger) is $(D LogLevel.info).
+ lv = The `LogLevel` for the `FileLogger`. By default the
+ `LogLevel` for `FileLogger` is `LogLevel.info`.
Example:
-------------
@@ -60,7 +60,7 @@ class FileLogger : Logger
this.file_ = file;
}
- /** If the $(D FileLogger) is managing the $(D File) it logs to, this
+ /** If the `FileLogger` is managing the `File` it logs to, this
method will return a reference to this File.
*/
@property File file() @safe
@@ -69,7 +69,7 @@ class FileLogger : Logger
}
/* This method overrides the base class method in order to log to a file
- without requiring heap allocated memory. Additionally, the $(D FileLogger)
+ without requiring heap allocated memory. Additionally, the `FileLogger`
local mutex is logged to serialize the log calls.
*/
override protected void beginLogMsg(string file, int line, string funcName,
@@ -96,8 +96,8 @@ class FileLogger : Logger
}
/* This methods overrides the base class method and finalizes the active
- log call. This requires flushing the $(D File) and releasing the
- $(D FileLogger) local mutex.
+ log call. This requires flushing the `File` and releasing the
+ `FileLogger` local mutex.
*/
override protected void finishLogMsg()
{
@@ -106,7 +106,7 @@ class FileLogger : Logger
}
/* This methods overrides the base class method and delegates the
- $(D LogEntry) data to the actual implementation.
+ `LogEntry` data to the actual implementation.
*/
override protected void writeLogMsg(ref LogEntry payload)
{
@@ -117,8 +117,8 @@ class FileLogger : Logger
this.finishLogMsg();
}
- /** If the $(D FileLogger) was constructed with a filename, this method
- returns this filename. Otherwise an empty $(D string) is returned.
+ /** If the `FileLogger` was constructed with a filename, this method
+ returns this filename. Otherwise an empty `string` is returned.
*/
string getFilename()
{
diff --git a/std/experimental/logger/multilogger.d b/std/experimental/logger/multilogger.d
index 18ec7213dcf..4782fe06635 100644
--- a/std/experimental/logger/multilogger.d
+++ b/std/experimental/logger/multilogger.d
@@ -3,31 +3,31 @@ module std.experimental.logger.multilogger;
import std.experimental.logger.core;
import std.experimental.logger.filelogger;
-/** This Element is stored inside the $(D MultiLogger) and associates a
-$(D Logger) to a $(D string).
+/** This Element is stored inside the `MultiLogger` and associates a
+`Logger` to a `string`.
*/
struct MultiLoggerEntry
{
- string name; /// The name if the $(D Logger)
- Logger logger; /// The stored $(D Logger)
+ string name; /// The name if the `Logger`
+ Logger logger; /// The stored `Logger`
}
-/** MultiLogger logs to multiple $(D Logger). The $(D Logger)s are stored in an
-$(D Logger[]) in there order of insertion.
+/** MultiLogger logs to multiple `Logger`. The `Logger`s are stored in an
+`Logger[]` in there order of insertion.
-Every data logged to this $(D MultiLogger) will be distributed to all the $(D
-Logger)s inserted into inserted it. This $(D MultiLogger) implementation can
-hold multiple $(D Logger)s with the same name. If the method $(D removeLogger)
-is used to remove a $(D Logger) only the first occurrence with that name will
+Every data logged to this `MultiLogger` will be distributed to all the $(D
+Logger)s inserted into inserted it. This `MultiLogger` implementation can
+hold multiple `Logger`s with the same name. If the method `removeLogger`
+is used to remove a `Logger` only the first occurrence with that name will
be removed.
*/
class MultiLogger : Logger
{
- /** A constructor for the $(D MultiLogger) Logger.
+ /** A constructor for the `MultiLogger` Logger.
Params:
- lv = The $(D LogLevel) for the $(D MultiLogger). By default the
- $(D LogLevel) for $(D MultiLogger) is $(D LogLevel.info).
+ lv = The `LogLevel` for the `MultiLogger`. By default the
+ `LogLevel` for `MultiLogger` is `LogLevel.info`.
Example:
-------------
@@ -39,32 +39,32 @@ class MultiLogger : Logger
super(lv);
}
- /** This member holds all $(D Logger) stored in the $(D MultiLogger).
+ /** This member holds all `Logger` stored in the `MultiLogger`.
- When inheriting from $(D MultiLogger) this member can be used to gain
- access to the stored $(D Logger).
+ When inheriting from `MultiLogger` this member can be used to gain
+ access to the stored `Logger`.
*/
protected MultiLoggerEntry[] logger;
- /** This method inserts a new Logger into the $(D MultiLogger).
+ /** This method inserts a new Logger into the `MultiLogger`.
Params:
- name = The name of the $(D Logger) to insert.
- newLogger = The $(D Logger) to insert.
+ name = The name of the `Logger` to insert.
+ newLogger = The `Logger` to insert.
*/
void insertLogger(string name, Logger newLogger) @safe
{
this.logger ~= MultiLoggerEntry(name, newLogger);
}
- /** This method removes a Logger from the $(D MultiLogger).
+ /** This method removes a Logger from the `MultiLogger`.
Params:
- toRemove = The name of the $(D Logger) to remove. If the $(D Logger)
- is not found $(D null) will be returned. Only the first occurrence of
- a $(D Logger) with the given name will be removed.
+ toRemove = The name of the `Logger` to remove. If the `Logger`
+ is not found `null` will be returned. Only the first occurrence of
+ a `Logger` with the given name will be removed.
- Returns: The removed $(D Logger).
+ Returns: The removed `Logger`.
*/
Logger removeLogger(in char[] toRemove) @safe
{
@@ -86,7 +86,7 @@ class MultiLogger : Logger
}
/* The override to pass the payload to all children of the
- $(D MultiLoggerBase).
+ `MultiLoggerBase`.
*/
override protected void writeLogMsg(ref LogEntry payload) @safe
{
diff --git a/std/experimental/logger/nulllogger.d b/std/experimental/logger/nulllogger.d
index bfa7981144e..d7b19dcbb74 100644
--- a/std/experimental/logger/nulllogger.d
+++ b/std/experimental/logger/nulllogger.d
@@ -2,19 +2,19 @@ module std.experimental.logger.nulllogger;
import std.experimental.logger.core;
-/** The $(D NullLogger) will not process any log messages.
+/** The `NullLogger` will not process any log messages.
-In case of a log message with $(D LogLevel.fatal) nothing will happen.
+In case of a log message with `LogLevel.fatal` nothing will happen.
*/
class NullLogger : Logger
{
- /** The default constructor for the $(D NullLogger).
+ /** The default constructor for the `NullLogger`.
Independent of the parameter this Logger will never log a message.
Params:
- lv = The $(D LogLevel) for the $(D NullLogger). By default the $(D LogLevel)
- for $(D NullLogger) is $(D LogLevel.info).
+ lv = The `LogLevel` for the `NullLogger`. By default the `LogLevel`
+ for `NullLogger` is `LogLevel.info`.
*/
this(const LogLevel lv = LogLevel.info) @safe
{
diff --git a/std/experimental/logger/package.d b/std/experimental/logger/package.d
index f45320a7c3d..103a06656f0 100644
--- a/std/experimental/logger/package.d
+++ b/std/experimental/logger/package.d
@@ -3,11 +3,11 @@ Implements logging facilities.
Message logging is a common approach to expose runtime information of a
program. Logging should be easy, but also flexible and powerful, therefore
-$(D D) provides a standard interface for logging.
+`D` provides a standard interface for logging.
The easiest way to create a log message is to write
$(D import std.logger; log("I am here");) this will print a message to the
-$(D stderr) device. The message will contain the filename, the linenumber, the
+`stderr` device. The message will contain the filename, the linenumber, the
name of the surrounding function, the time and the message.
Copyright: Copyright Robert "burner" Schadek 2013 --
@@ -34,61 +34,61 @@ fLogger.log(LogLevel.trace, 5 < 6, "Logging to the fileLogger"," with its defaul
fLogger.fatal("Logging to the fileLogger with its warning LogLevel");
-------------
-Top-level calls to logging-related functions go to the default $(D Logger)
-object called $(D sharedLog).
-$(LI $(D log))
-$(LI $(D trace))
-$(LI $(D info))
-$(LI $(D warning))
-$(LI $(D critical))
-$(LI $(D fatal))
-The default $(D Logger) will by default log to $(D stderr) and has a default
-$(D LogLevel) of $(D LogLevel.all). The default Logger can be accessed by
-using the property called $(D sharedLog). This property a reference to the
-current default $(D Logger). This reference can be used to assign a new
-default $(D Logger).
+Top-level calls to logging-related functions go to the default `Logger`
+object called `sharedLog`.
+$(LI `log`)
+$(LI `trace`)
+$(LI `info`)
+$(LI `warning`)
+$(LI `critical`)
+$(LI `fatal`)
+The default `Logger` will by default log to `stderr` and has a default
+`LogLevel` of `LogLevel.all`. The default Logger can be accessed by
+using the property called `sharedLog`. This property a reference to the
+current default `Logger`. This reference can be used to assign a new
+default `Logger`.
-------------
sharedLog = new FileLogger("New_Default_Log_File.log");
-------------
-Additional $(D Logger) can be created by creating a new instance of the
-required $(D Logger).
-
-The $(D LogLevel) of an log call can be defined in two ways. The first is by
-calling $(D log) and passing the $(D LogLevel) explicit as the first argument.
-The second way of setting the $(D LogLevel) of a
-log call, is by calling either $(D trace), $(D info), $(D warning),
-$(D critical), or $(D fatal). The log call will than have the respective
-$(D LogLevel). If no $(D LogLevel) is defined the log call will use the
-current $(D LogLevel) of the used $(D Logger). If data is logged with
-$(D LogLevel) $(D fatal) by default an $(D Error) will be thrown.
-This behaviour can be modified by using the member $(D fatalHandler) to
-assign a custom delegate to handle log call with $(D LogLevel) $(D fatal).
-
-Conditional logging can be achieved be appending passing a $(D bool) as first
+Additional `Logger` can be created by creating a new instance of the
+required `Logger`.
+
+The `LogLevel` of an log call can be defined in two ways. The first is by
+calling `log` and passing the `LogLevel` explicit as the first argument.
+The second way of setting the `LogLevel` of a
+log call, is by calling either `trace`, `info`, `warning`,
+`critical`, or `fatal`. The log call will than have the respective
+`LogLevel`. If no `LogLevel` is defined the log call will use the
+current `LogLevel` of the used `Logger`. If data is logged with
+`LogLevel` `fatal` by default an `Error` will be thrown.
+This behaviour can be modified by using the member `fatalHandler` to
+assign a custom delegate to handle log call with `LogLevel` `fatal`.
+
+Conditional logging can be achieved be appending passing a `bool` as first
argument to a log function. If conditional logging is used the condition must
-be $(D true) in order to have the log message logged.
+be `true` in order to have the log message logged.
-In order to combine an explicit $(D LogLevel) passing with conditional
-logging, the $(D LogLevel) has to be passed as first argument followed by the
-$(D bool).
+In order to combine an explicit `LogLevel` passing with conditional
+logging, the `LogLevel` has to be passed as first argument followed by the
+`bool`.
-Messages are logged if the $(D LogLevel) of the log message is greater than or
-equal to than the $(D LogLevel) of the used $(D Logger) and additionally if the
-$(D LogLevel) of the log message is greater equal to the global $(D LogLevel).
+Messages are logged if the `LogLevel` of the log message is greater than or
+equal to than the `LogLevel` of the used `Logger` and additionally if the
+`LogLevel` of the log message is greater equal to the global `LogLevel`.
If a condition is passed into the log call, this condition must be true.
-The global $(D LogLevel) is accessible by using $(D globalLogLevel).
-To assign the $(D LogLevel) of a $(D Logger) use the $(D logLevel) property of
+The global `LogLevel` is accessible by using `globalLogLevel`.
+To assign the `LogLevel` of a `Logger` use the `logLevel` property of
the logger.
-If $(D printf)-style logging is needed add a $(B f) to the logging call, such as
+If `printf`-style logging is needed add a $(B f) to the logging call, such as
$(D myLogger.infof("Hello %s", "world");) or $(fatalf("errno %d", 1337))
-The additional $(B f) enables $(D printf)-style logging for call combinations of
-explicit $(D LogLevel) and conditional logging functions and methods.
+The additional $(B f) enables `printf`-style logging for call combinations of
+explicit `LogLevel` and conditional logging functions and methods.
-To customize the $(D Logger) behavior, create a new $(D class) that inherits from
-the abstract $(D Logger) $(D class), and implements the $(D writeLogMsg)
+To customize the `Logger` behavior, create a new `class` that inherits from
+the abstract `Logger` `class`, and implements the `writeLogMsg`
method.
-------------
class MyCustomLogger : Logger
@@ -109,38 +109,38 @@ logger.log("Awesome log message");
-------------
To gain more precise control over the logging process, additionally to
-overwriting the $(D writeLogMsg) method the methods $(D beginLogMsg),
-$(D logMsgPart) and $(D finishLogMsg) can be overwritten.
+overwriting the `writeLogMsg` method the methods `beginLogMsg`,
+`logMsgPart` and `finishLogMsg` can be overwritten.
-In order to disable logging at compile time, pass $(D StdLoggerDisableLogging) as a
-version argument to the $(D D) compiler when compiling your program code.
+In order to disable logging at compile time, pass `StdLoggerDisableLogging` as a
+version argument to the `D` compiler when compiling your program code.
This will disable all logging functionality.
-Specific $(D LogLevel) can be disabled at compile time as well.
-In order to disable logging with the $(D trace) $(D LogLevel) pass
-$(D StdLoggerDisableTrace) as a version.
+Specific `LogLevel` can be disabled at compile time as well.
+In order to disable logging with the `trace` `LogLevel` pass
+`StdLoggerDisableTrace` as a version.
The following table shows which version statement disables which
-$(D LogLevel).
+`LogLevel`.
$(TABLE
- $(TR $(TD $(D LogLevel.trace) ) $(TD StdLoggerDisableTrace))
- $(TR $(TD $(D LogLevel.info) ) $(TD StdLoggerDisableInfo))
- $(TR $(TD $(D LogLevel.warning) ) $(TD StdLoggerDisableWarning))
- $(TR $(TD $(D LogLevel.error) ) $(TD StdLoggerDisableError))
- $(TR $(TD $(D LogLevel.critical) ) $(TD StdLoggerDisableCritical))
- $(TR $(TD $(D LogLevel.fatal) ) $(TD StdLoggerDisableFatal))
+ $(TR $(TD `LogLevel.trace` ) $(TD StdLoggerDisableTrace))
+ $(TR $(TD `LogLevel.info` ) $(TD StdLoggerDisableInfo))
+ $(TR $(TD `LogLevel.warning` ) $(TD StdLoggerDisableWarning))
+ $(TR $(TD `LogLevel.error` ) $(TD StdLoggerDisableError))
+ $(TR $(TD `LogLevel.critical` ) $(TD StdLoggerDisableCritical))
+ $(TR $(TD `LogLevel.fatal` ) $(TD StdLoggerDisableFatal))
)
Such a version statement will only disable logging in the associated compile
unit.
-By default four $(D Logger) implementations are given. The $(D FileLogger)
-logs data to files. It can also be used to log to $(D stdout) and $(D stderr)
-as these devices are files as well. A $(D Logger) that logs to $(D stdout) can
+By default four `Logger` implementations are given. The `FileLogger`
+logs data to files. It can also be used to log to `stdout` and `stderr`
+as these devices are files as well. A `Logger` that logs to `stdout` can
therefore be created by $(D new FileLogger(stdout)).
-The $(D MultiLogger) is basically an associative array of $(D string)s to
-$(D Logger). It propagates log calls to its stored $(D Logger). The
-$(D ArrayLogger) contains an array of $(D Logger) and also propagates log
-calls to its stored $(D Logger). The $(D NullLogger) does not do anything. It
-will never log a message and will never throw on a log call with $(D LogLevel)
-$(D error).
+The `MultiLogger` is basically an associative array of `string`s to
+`Logger`. It propagates log calls to its stored `Logger`. The
+`ArrayLogger` contains an array of `Logger` and also propagates log
+calls to its stored `Logger`. The `NullLogger` does not do anything. It
+will never log a message and will never throw on a log call with `LogLevel`
+`error`.
*/
module std.experimental.logger;
diff --git a/std/file.d b/std/file.d
index f2437621cb6..08daaa5ba7f 100644
--- a/std/file.d
+++ b/std/file.d
@@ -4,7 +4,7 @@
Utilities for manipulating files and scanning directories. Functions
in this module handle files as a unit, e.g., read or write one _file
at a time. For opening files and manipulating them via handles refer
-to module $(LINK2 std_stdio.html,$(D std.stdio)).
+to module $(LINK2 std_stdio.html,`std.stdio`).
Macros:
WIKI = Phobos/StdFile
@@ -171,8 +171,8 @@ private T cenforce(T)(T condition, lazy const(char)[] name, string file = __FILE
*/
/********************************************
-Read entire contents of file $(D name) and returns it as an untyped
-array. If the file size is larger than $(D upTo), only $(D upTo)
+Read entire contents of file `name` and returns it as an untyped
+array. If the file size is larger than `upTo`, only `upTo`
bytes are read.
Example:
@@ -189,7 +189,7 @@ void main()
Returns: Untyped array of bytes _read.
-Throws: $(D FileException) on error.
+Throws: `FileException` on error.
*/
void[] read(in char[] name, size_t upTo = size_t.max) @safe
{
@@ -332,15 +332,15 @@ version (linux) @safe unittest
}
/********************************************
-Read and validates (using $(XREF utf, validate)) a text file. $(D S)
+Read and validates (using $(XREF utf, validate)) a text file. `S`
can be a type of array of characters of any width and constancy. No
width conversion is performed; if the width of the characters in file
-$(D name) is different from the width of elements of $(D S),
+`name` is different from the width of elements of `S`,
validation will fail.
Returns: Array of characters read.
-Throws: $(D FileException) on file error, $(D UTFException) on UTF
+Throws: `FileException` on file error, `UTFException` on UTF
decoding error.
Example:
@@ -370,8 +370,8 @@ S readText(S = string)(in char[] name) @safe if (isSomeString!S)
}
/*********************************************
-Write $(D buffer) to file $(D name).
-Throws: $(D FileException) on error.
+Write `buffer` to file `name`.
+Throws: `FileException` on error.
Example:
@@ -407,8 +407,8 @@ void write(in char[] name, const void[] buffer) @trusted
}
/*********************************************
-Appends $(D buffer) to file $(D name).
-Throws: $(D FileException) on error.
+Appends `buffer` to file `name`.
+Throws: `FileException` on error.
Example:
@@ -465,9 +465,9 @@ version(Posix) private void writeImpl(in char[] name,
}
/***************************************************
- * Rename file $(D from) to $(D to).
+ * Rename file `from` to `to`.
* If the target file exists, it is overwritten.
- * Throws: $(D FileException) on error.
+ * Throws: `FileException` on error.
*/
void rename(in char[] from, in char[] to) @trusted
{
@@ -500,8 +500,8 @@ void rename(in char[] from, in char[] to) @trusted
/***************************************************
-Delete file $(D name).
-Throws: $(D FileException) on error.
+Delete file `name`.
+Throws: `FileException` on error.
*/
void remove(in char[] name) @trusted
{
@@ -534,9 +534,9 @@ version(Windows) private ulong makeUlong(DWORD dwLow, DWORD dwHigh) @safe pure n
}
/***************************************************
-Get size of file $(D name) in bytes.
+Get size of file `name` in bytes.
-Throws: $(D FileException) on error (e.g., file not found).
+Throws: `FileException` on error (e.g., file not found).
*/
ulong getSize(in char[] name) @safe
{
@@ -574,7 +574,7 @@ ulong getSize(in char[] name) @safe
/++
- Get the access and modified times of file or folder $(D name).
+ Get the access and modified times of file or folder `name`.
Params:
name = File/Folder name to get times for.
@@ -582,7 +582,7 @@ ulong getSize(in char[] name) @safe
modificationTime = Time the file/folder was last modified.
Throws:
- $(D FileException) on error.
+ `FileException` on error.
+/
void getTimes(in char[] name,
out SysTime accessTime,
@@ -669,9 +669,9 @@ unittest
/++
$(BLUE This function is Windows-Only.)
- Get creation/access/modified times of file $(D name).
+ Get creation/access/modified times of file `name`.
- This is the same as $(D getTimes) except that it also gives you the file
+ This is the same as `getTimes` except that it also gives you the file
creation time - which isn't possible on Posix systems.
Params:
@@ -681,7 +681,7 @@ unittest
fileModificationTime = Time the file was last modified.
Throws:
- $(D FileException) on error.
+ `FileException` on error.
+/
version(StdDdoc) void getTimesWin(in char[] name,
out SysTime fileCreationTime,
@@ -767,7 +767,7 @@ version(Windows) unittest
/++
- Set access/modified times of file or folder $(D name).
+ Set access/modified times of file or folder `name`.
Params:
name = File/Folder name to get times for.
@@ -775,7 +775,7 @@ version(Windows) unittest
modificationTime = Time the file/folder was last modified.
Throws:
- $(D FileException) on error.
+ `FileException` on error.
+/
void setTimes(in char[] name,
SysTime accessTime,
@@ -867,7 +867,7 @@ unittest
Returns the time that the given file was last modified.
Throws:
- $(D FileException) if the given file does not exist.
+ `FileException` if the given file does not exist.
+/
SysTime timeLastModified(in char[] name) @safe
{
@@ -897,16 +897,16 @@ SysTime timeLastModified(in char[] name) @safe
/++
Returns the time that the given file was last modified. If the
- file does not exist, returns $(D returnIfMissing).
+ file does not exist, returns `returnIfMissing`.
A frequent usage pattern occurs in build automation tools such as
$(WEB gnu.org/software/make, make) or $(WEB
en.wikipedia.org/wiki/Apache_Ant, ant). To check whether file $(D
- target) must be rebuilt from file $(D source) (i.e., $(D target) is
- older than $(D source) or does not exist), use the comparison
- below. The code throws a $(D FileException) if $(D source) does not
- exist (as it should). On the other hand, the $(D SysTime.min) default
- makes a non-existing $(D target) seem infinitely old so the test
+ target) must be rebuilt from file `source` (i.e., `target` is
+ older than `source` or does not exist), use the comparison
+ below. The code throws a `FileException` if `source` does not
+ exist (as it should). On the other hand, the `SysTime.min` default
+ makes a non-existing `target` seem infinitely old so the test
correctly prompts building it.
Params:
@@ -1029,7 +1029,7 @@ bool exists(in char[] name) @trusted nothrow @nogc
msdn.microsoft.com/en-us/library/aa364944(v=vs.85).aspx,
GetFileAttributes), whereas on Posix systems, they're the $(LUCKY
st_mode) value which is part of the $(D stat struct) gotten by
- calling the $(WEB en.wikipedia.org/wiki/Stat_%28Unix%29, $(D stat))
+ calling the $(WEB en.wikipedia.org/wiki/Stat_%28Unix%29, `stat`)
function.
On Posix systems, if the given file is a symbolic link, then
@@ -1039,7 +1039,7 @@ bool exists(in char[] name) @trusted nothrow @nogc
Params:
name = The file to get the attributes of.
- Throws: $(D FileException) on error.
+ Throws: `FileException` on error.
+/
uint getAttributes(in char[] name) @safe
{
@@ -1084,7 +1084,7 @@ uint getAttributes(in char[] name) @safe
name = The file to get the symbolic link attributes of.
Throws:
- $(D FileException) on error.
+ `FileException` on error.
+/
uint getLinkAttributes(in char[] name) @safe
{
@@ -1109,7 +1109,7 @@ uint getLinkAttributes(in char[] name) @safe
Set the attributes of the given file.
Throws:
- $(D FileException) if the given file does not exist.
+ `FileException` if the given file does not exist.
+/
void setAttributes(in char[] name, uint attributes) @safe
{
@@ -1140,7 +1140,7 @@ void setAttributes(in char[] name, uint attributes) @safe
name = The path to the file.
Throws:
- $(D FileException) if the given file does not exist.
+ `FileException` if the given file does not exist.
Examples:
--------------------
@@ -1242,22 +1242,22 @@ bool attrIsDir(uint attributes) @safe pure nothrow @nogc
Returns whether the given file (or directory) is a file.
On Windows, if a file is not a directory, then it's a file. So,
- either $(D isFile) or $(D isDir) will return true for any given file.
+ either `isFile` or `isDir` will return true for any given file.
- On Posix systems, if $(D isFile) is $(D true), that indicates that the file
+ On Posix systems, if `isFile` is `true`, that indicates that the file
is a regular file (e.g. not a block not device). So, on Posix systems, it's
- possible for both $(D isFile) and $(D isDir) to be $(D false) for a
+ possible for both `isFile` and `isDir` to be `false` for a
particular file (in which case, it's a special file). You can use
- $(D getAttributes) to get the attributes to figure out what type of special
- it is, or you can use $(D DirEntry) to get at its $(D statBuf), which is the
- result from $(D stat). In either case, see the man page for $(D stat) for
+ `getAttributes` to get the attributes to figure out what type of special
+ it is, or you can use `DirEntry` to get at its `statBuf`, which is the
+ result from `stat`. In either case, see the man page for `stat` for
more information.
Params:
name = The path to the file.
Throws:
- $(D FileException) if the given file does not exist.
+ `FileException` if the given file does not exist.
Examples:
--------------------
@@ -1298,15 +1298,15 @@ assert(!"/usr/share/include".isFile);
Returns whether the given file attributes are for a file.
On Windows, if a file is not a directory, it's a file. So, either
- $(D attrIsFile) or $(D attrIsDir) will return $(D true) for the
+ `attrIsFile` or `attrIsDir` will return `true` for the
attributes of any given file.
- On Posix systems, if $(D attrIsFile) is $(D true), that indicates that the
+ On Posix systems, if `attrIsFile` is `true`, that indicates that the
file is a regular file (e.g. not a block not device). So, on Posix systems,
- it's possible for both $(D attrIsFile) and $(D attrIsDir) to be $(D false)
+ it's possible for both `attrIsFile` and `attrIsDir` to be `false`
for a particular file (in which case, it's a special file). If a file is a
special file, you can use the attributes to check what type of special file
- it is (see the man page for $(D stat) for more information).
+ it is (see the man page for `stat` for more information).
Params:
attributes = The file attributes.
@@ -1365,14 +1365,14 @@ bool attrIsFile(uint attributes) @safe pure nothrow @nogc
/++
Returns whether the given file is a symbolic link.
- On Windows, returns $(D true) when the file is either a symbolic link or a
+ On Windows, returns `true` when the file is either a symbolic link or a
junction point.
Params:
name = The path to the file.
Throws:
- $(D FileException) if the given file does not exist.
+ `FileException` if the given file does not exist.
+/
@property bool isSymlink(in char[] name) @safe
{
@@ -1459,7 +1459,7 @@ unittest
/++
Returns whether the given file attributes are for a symbolic link.
- On Windows, return $(D true) when the file is either a symbolic link or a
+ On Windows, return `true` when the file is either a symbolic link or a
junction point.
Params:
@@ -1483,8 +1483,8 @@ bool attrIsSymlink(uint attributes) @safe pure nothrow @nogc
/****************************************************
- * Change directory to $(D pathname).
- * Throws: $(D FileException) on error.
+ * Change directory to `pathname`.
+ * Throws: `FileException` on error.
*/
void chdir(in char[] pathname) @safe
{
@@ -1507,9 +1507,9 @@ void chdir(in char[] pathname) @safe
}
/****************************************************
-Make directory $(D pathname).
+Make directory `pathname`.
-Throws: $(D FileException) on Posix or $(D WindowsException) on Windows
+Throws: `FileException` on Posix or `WindowsException` on Windows
if an error occured.
*/
void mkdir(in char[] pathname) @safe
@@ -1556,7 +1556,7 @@ private bool ensureDirExists(in char[] pathname)
/****************************************************
* Make directory and all parent directories as needed.
*
- * Throws: $(D FileException) on error.
+ * Throws: `FileException` on error.
*/
void mkdirRecurse(in char[] pathname)
@@ -1617,9 +1617,9 @@ unittest
}
/****************************************************
-Remove directory $(D pathname).
+Remove directory `pathname`.
-Throws: $(D FileException) on error.
+Throws: `FileException` on error.
*/
void rmdir(in char[] pathname)
{
@@ -1649,7 +1649,7 @@ void rmdir(in char[] pathname)
not the files being linked to or from.
Throws:
- $(D FileException) on error (which includes if the symlink already
+ `FileException` on error (which includes if the symlink already
exists).
+/
version(StdDdoc) void symlink(C1, C2)(const(C1)[] original, const(C2)[] link) @safe;
@@ -1716,7 +1716,7 @@ version(Posix) @safe unittest
working directory.
Throws:
- $(D FileException) on error.
+ `FileException` on error.
+/
version(StdDdoc) string readLink(C)(const(C)[] link) @safe;
else version(Posix) string readLink(C)(const(C)[] link) @safe
@@ -1779,7 +1779,7 @@ version(Posix) @safe unittest
/****************************************************
* Get the current working directory.
- * Throws: $(D FileException) on error.
+ * Throws: `FileException` on error.
*/
version(Windows) string getcwd()
{
@@ -1935,7 +1935,7 @@ version(StdDdoc)
path = The file (or directory) to get a DirEntry for.
Throws:
- $(D FileException) if the file does not exist.
+ `FileException` if the file does not exist.
+/
this(string path);
@@ -1949,7 +1949,7 @@ version(StdDdoc)
}
/++
- Returns the path to the file represented by this $(D DirEntry).
+ Returns the path to the file represented by this `DirEntry`.
Examples:
--------------------
@@ -1964,7 +1964,7 @@ assert(de2.name == "/usr/share/include");
/++
- Returns whether the file represented by this $(D DirEntry) is a
+ Returns whether the file represented by this `DirEntry` is a
directory.
Examples:
@@ -1980,16 +1980,16 @@ assert(de2.isDir);
/++
- Returns whether the file represented by this $(D DirEntry) is a file.
+ Returns whether the file represented by this `DirEntry` is a file.
On Windows, if a file is not a directory, then it's a file. So,
- either $(D isFile) or $(D isDir) will return $(D true).
+ either `isFile` or `isDir` will return `true`.
- On Posix systems, if $(D isFile) is $(D true), that indicates that
+ On Posix systems, if `isFile` is `true`, that indicates that
the file is a regular file (e.g. not a block not device). So, on
- Posix systems, it's possible for both $(D isFile) and $(D isDir) to
- be $(D false) for a particular file (in which case, it's a special
- file). You can use $(D attributes) or $(D statBuf) to get more
+ Posix systems, it's possible for both `isFile` and `isDir` to
+ be `false` for a particular file (in which case, it's a special
+ file). You can use `attributes` or `statBuf` to get more
information about a special file (see the stat man page for more
details).
@@ -2005,16 +2005,16 @@ assert(!de2.isFile);
@property bool isFile();
/++
- Returns whether the file represented by this $(D DirEntry) is a
+ Returns whether the file represented by this `DirEntry` is a
symbolic link.
- On Windows, return $(D true) when the file is either a symbolic
+ On Windows, return `true` when the file is either a symbolic
link or a junction point.
+/
@property bool isSymlink();
/++
- Returns the size of the the file represented by this $(D DirEntry)
+ Returns the size of the the file represented by this `DirEntry`
in bytes.
+/
@property ulong size();
@@ -2023,50 +2023,50 @@ assert(!de2.isFile);
$(BLUE This function is Windows-Only.)
Returns the creation time of the file represented by this
- $(D DirEntry).
+ `DirEntry`.
+/
@property SysTime timeCreated() const;
/++
- Returns the time that the file represented by this $(D DirEntry) was
+ Returns the time that the file represented by this `DirEntry` was
last accessed.
Note that many file systems do not update the access time for files
(generally for performance reasons), so there's a good chance that
- $(D timeLastAccessed) will return the same value as
- $(D timeLastModified).
+ `timeLastAccessed` will return the same value as
+ `timeLastModified`.
+/
@property SysTime timeLastAccessed();
/++
- Returns the time that the file represented by this $(D DirEntry) was
+ Returns the time that the file represented by this `DirEntry` was
last modified.
+/
@property SysTime timeLastModified();
/++
- Returns the attributes of the file represented by this $(D DirEntry).
+ Returns the attributes of the file represented by this `DirEntry`.
Note that the file attributes on Windows and Posix systems are
completely different. On, Windows, they're what is returned by
- $(D GetFileAttributes)
+ `GetFileAttributes`
$(WEB msdn.microsoft.com/en-us/library/aa364944(v=vs.85).aspx, GetFileAttributes)
Whereas, an Posix systems, they're the $(D st_mode) value which is
- part of the $(D stat) struct gotten by calling $(D stat).
+ part of the `stat` struct gotten by calling `stat`.
- On Posix systems, if the file represented by this $(D DirEntry) is a
+ On Posix systems, if the file represented by this `DirEntry` is a
symbolic link, then attributes are the attributes of the file
pointed to by the symbolic link.
+/
@property uint attributes();
/++
- On Posix systems, if the file represented by this $(D DirEntry) is a
- symbolic link, then $(D linkAttributes) are the attributes of the
- symbolic link itself. Otherwise, $(D linkAttributes) is identical to
- $(D attributes).
+ On Posix systems, if the file represented by this `DirEntry` is a
+ symbolic link, then `linkAttributes` are the attributes of the
+ symbolic link itself. Otherwise, `linkAttributes` is identical to
+ `attributes`.
- On Windows, $(D linkAttributes) is identical to $(D attributes). It
+ On Windows, `linkAttributes` is identical to `attributes`. It
exists on Windows so that you don't have to special-case code for
Windows when dealing with symbolic links.
+/
@@ -2078,7 +2078,7 @@ assert(!de2.isFile);
/++
$(BLUE This function is Posix-Only.)
- The $(D stat) struct gotten from calling $(D stat).
+ The `stat` struct gotten from calling `stat`.
+/
@property stat_t statBuf();
}
@@ -2486,12 +2486,12 @@ else
}
/***************************************************
-Copy file $(D from) to file $(D to). File timestamps are preserved.
-File attributes are preserved, if $(D preserve) equals $(D PreserveAttributes.yes).
-On Windows only $(D PreserveAttributes.yes) (the default on Windows) is supported.
+Copy file `from` to file `to`. File timestamps are preserved.
+File attributes are preserved, if `preserve` equals `PreserveAttributes.yes`.
+On Windows only `PreserveAttributes.yes` (the default on Windows) is supported.
If the target file exists, it is overwritten.
-Throws: $(D FileException) on error.
+Throws: `FileException` on error.
*/
void copy(in char[] from, in char[] to, PreserveAttributes preserve = preserveAttributesDefault)
{
@@ -2583,7 +2583,7 @@ version(Posix) unittest //issue 11434
recursively.
Throws:
- $(D FileException) if there is an error (including if the given
+ `FileException` if there is an error (including if the given
file is not a directory).
+/
void rmdirRecurse(in char[] pathname)
@@ -2598,7 +2598,7 @@ void rmdirRecurse(in char[] pathname)
recursively.
Throws:
- $(D FileException) if there is an error (including if the given
+ `FileException` if there is an error (including if the given
file is not a directory).
+/
void rmdirRecurse(ref DirEntry de)
@@ -2946,7 +2946,7 @@ public:
iterated over.
Throws:
- $(D FileException) if the directory does not exist.
+ `FileException` if the directory does not exist.
Examples:
--------------------
@@ -3059,7 +3059,7 @@ unittest
iterated over.
Throws:
- $(D FileException) if the directory does not exist.
+ `FileException` if the directory does not exist.
Examples:
--------------------
@@ -3295,7 +3295,7 @@ auto a = slurp!(int, double)("filename", "%s, %s");
----
Bugs:
-$(D slurp) expects file names to be encoded in $(B CP_ACP) on $(I Windows)
+`slurp` expects file names to be encoded in $(B CP_ACP) on $(I Windows)
instead of UTF-8 (as it internally uses $(XREF stdio, File),
see $(BUGZILLA 7648)) thus must not be used in $(I Windows)
or cross-platform applications other than with an immediate ASCII string as
@@ -3340,20 +3340,20 @@ unittest
Returns the path to a directory for temporary files.
On Windows, this function returns the result of calling the Windows API function
-$(LINK2 http://msdn.microsoft.com/en-us/library/windows/desktop/aa364992.aspx, $(D GetTempPath)).
+$(LINK2 http://msdn.microsoft.com/en-us/library/windows/desktop/aa364992.aspx, `GetTempPath`).
On POSIX platforms, it searches through the following list of directories
and returns the first one which is found to exist:
$(OL
- $(LI The directory given by the $(D TMPDIR) environment variable.)
- $(LI The directory given by the $(D TEMP) environment variable.)
- $(LI The directory given by the $(D TMP) environment variable.)
- $(LI $(D /tmp))
- $(LI $(D /var/tmp))
- $(LI $(D /usr/tmp))
+ $(LI The directory given by the `TMPDIR` environment variable.)
+ $(LI The directory given by the `TEMP` environment variable.)
+ $(LI The directory given by the `TMP` environment variable.)
+ $(LI `/tmp`)
+ $(LI `/var/tmp`)
+ $(LI `/usr/tmp`)
)
-On all platforms, $(D tempDir) returns $(D ".") on failure, representing
+On all platforms, `tempDir` returns `"."` on failure, representing
the current working directory.
The return value of the function is cached, so the procedures described
@@ -3362,8 +3362,8 @@ subsequent runs will return the same string, regardless of whether
environment variables and directory structures have changed in the
meantime.
-The POSIX $(D tempDir) algorithm is inspired by Python's
-$(LINK2 http://docs.python.org/library/tempfile.html#tempfile.tempdir, $(D tempfile.tempdir)).
+The POSIX `tempDir` algorithm is inspired by Python's
+$(LINK2 http://docs.python.org/library/tempfile.html#tempfile.tempdir, `tempfile.tempdir`).
*/
string tempDir() @trusted
{
diff --git a/std/format.d b/std/format.d
index 209a0d998ff..8fa2ca43654 100644
--- a/std/format.d
+++ b/std/format.d
@@ -2,7 +2,7 @@
/**
This module implements the formatting functionality for strings and
- I/O. It's comparable to C99's $(D vsprintf()) and uses a similar
+ I/O. It's comparable to C99's `vsprintf()` and uses a similar
format encoding scheme.
For an introductory look at $(B std.format)'s capabilities and how to use
@@ -68,19 +68,19 @@ private alias enforceFmt = enforceEx!FormatException;
/**********************************************************************
- Interprets variadic argument list $(D args), formats them according
- to $(D fmt), and sends the resulting characters to $(D w). The
- encoding of the output is the same as $(D Char). The type $(D Writer)
+ Interprets variadic argument list `args`, formats them according
+ to `fmt`, and sends the resulting characters to `w`. The
+ encoding of the output is the same as `Char`. The type `Writer`
must satisfy $(XREF range,isOutputRange!(Writer, Char)).
The variadic arguments are normally consumed in order. POSIX-style
$(WEB opengroup.org/onlinepubs/009695399/functions/printf.html,
positional parameter syntax) is also supported. Each argument is
formatted into a sequence of chars according to the format
- specification, and the characters are passed to $(D w). As many
+ specification, and the characters are passed to `w`. As many
arguments as specified in the format string are consumed and
formatted. If there are fewer arguments than format specifiers, a
- $(D FormatException) is thrown. If there are more remaining arguments
+ `FormatException` is thrown. If there are more remaining arguments
than needed by the format specification, they are ignored but only
if at least one argument was formatted.
@@ -176,7 +176,7 @@ $(I FormatChar):
$(TR $(TD $(B '0')) $(TD numeric) $(TD Use leading
zeros to pad rather than spaces (except for the floating point
- values $(D nan) and $(D infinity)). Ignore if there's a $(I
+ values `nan` and `infinity`). Ignore if there's a $(I
Precision).))
$(TR $(TD $(B ' ')) $(TD numeric) $(TD Prefix positive
@@ -530,8 +530,8 @@ uint formattedWrite(Writer, Char, A...)(Writer w, in Char[] fmt, A args)
}
/**
-Reads characters from input range $(D r), converts them according
-to $(D fmt), and writes them to $(D args).
+Reads characters from input range `r`, converts them according
+to `fmt`, and writes them to `args`.
Params:
r = The range to read from.
@@ -623,7 +623,7 @@ template FormatSpec(Char)
}
/**
- * A General handler for $(D printf) style format specifiers. Used for building more
+ * A General handler for `printf` style format specifiers. Used for building more
* specific formatting functions.
*/
struct FormatSpec(Char)
@@ -634,7 +634,7 @@ struct FormatSpec(Char)
import std.conv : parse, text, to;
/**
- Minimum _width, default $(D 0).
+ Minimum _width, default `0`.
*/
int width = 0;
@@ -646,8 +646,8 @@ struct FormatSpec(Char)
int precision = UNSPECIFIED;
/**
- Special value for width and precision. $(D DYNAMIC) width or
- precision means that they were specified with $(D '*') in the
+ Special value for width and precision. `DYNAMIC` width or
+ precision means that they were specified with `'*'` in the
format string and are passed at runtime through the varargs.
*/
enum int DYNAMIC = int.max;
@@ -659,50 +659,50 @@ struct FormatSpec(Char)
enum int UNSPECIFIED = DYNAMIC - 1;
/**
- The actual format specifier, $(D 's') by default.
+ The actual format specifier, `'s'` by default.
*/
char spec = 's';
/**
- Index of the argument for positional parameters, from $(D 1) to
- $(D ubyte.max). ($(D 0) means not used).
+ Index of the argument for positional parameters, from `1` to
+ `ubyte.max`. (`0` means not used).
*/
ubyte indexStart;
/**
Index of the last argument for positional parameter range, from
- $(D 1) to $(D ubyte.max). ($(D 0) means not used).
+ `1` to `ubyte.max`. (`0` means not used).
*/
ubyte indexEnd;
version(StdDdoc)
{
/**
- The format specifier contained a $(D '-') ($(D printf)
+ The format specifier contained a `'-'` (`printf`
compatibility).
*/
bool flDash;
/**
- The format specifier contained a $(D '0') ($(D printf)
+ The format specifier contained a `'0'` (`printf`
compatibility).
*/
bool flZero;
/**
- The format specifier contained a $(D ' ') ($(D printf)
+ The format specifier contained a $(D ' ') (`printf`
compatibility).
*/
bool flSpace;
/**
- The format specifier contained a $(D '+') ($(D printf)
+ The format specifier contained a `'+'` (`printf`
compatibility).
*/
bool flPlus;
/**
- The format specifier contained a $(D '#') ($(D printf)
+ The format specifier contained a `'#'` (`printf`
compatibility).
*/
bool flHash;
@@ -735,7 +735,7 @@ struct FormatSpec(Char)
/**
In case of a compound format specifier, $(D _sep) contains the
- string positioning after $(D "%|").
+ string positioning after `"%|"`.
*/
const(Char)[] sep;
@@ -746,19 +746,19 @@ struct FormatSpec(Char)
/*
This string is inserted before each sequence (e.g. array)
- formatted (by default $(D "[")).
+ formatted (by default `"["`).
*/
enum immutable(Char)[] seqBefore = "[";
/*
This string is inserted after each sequence formatted (by
- default $(D "]")).
+ default `"]"`).
*/
enum immutable(Char)[] seqAfter = "]";
/*
This string is inserted after each element keys of a sequence (by
- default $(D ":")).
+ default `":"`).
*/
enum immutable(Char)[] keySeparator = ":";
@@ -769,7 +769,7 @@ struct FormatSpec(Char)
enum immutable(Char)[] seqSeparator = ", ";
/**
- Construct a new $(D FormatSpec) using the format string $(D fmt), no
+ Construct a new `FormatSpec` using the format string `fmt`, no
processing is done until needed.
*/
this(in Char[] fmt) @safe pure
@@ -1201,14 +1201,14 @@ struct FormatSpec(Char)
}
/**
-Helper function that returns a $(D FormatSpec) for a single specifier given
-in $(D fmt)
+Helper function that returns a `FormatSpec` for a single specifier given
+in `fmt`
Params:
fmt = A format specifier
Returns:
- A $(D FormatSpec) with the specifier parsed.
+ A `FormatSpec` with the specifier parsed.
Enforces giving only one specifier to the function.
*/
@@ -1248,13 +1248,13 @@ unittest
}
/**
-$(D bool)s are formatted as "true" or "false" with %s and as "1" or
+`bool`s are formatted as "true" or "false" with %s and as "1" or
"0" with integral-specific format specs.
Params:
- w = The $(D OutputRange) to write to.
+ w = The `OutputRange` to write to.
obj = The value to write.
- f = The $(D FormatSpec) defining how to write the value.
+ f = The `FormatSpec` defining how to write the value.
*/
void formatValue(Writer, T, Char)(Writer w, T obj, ref FormatSpec!Char f)
if (is(BooleanTypeOf!T) && !is(T == enum) && !hasToString!(T, Char))
@@ -1331,12 +1331,12 @@ unittest
}
/**
-$(D null) literal is formatted as $(D "null").
+`null` literal is formatted as `"null"`.
Params:
- w = The $(D OutputRange) to write to.
+ w = The `OutputRange` to write to.
obj = The value to write.
- f = The $(D FormatSpec) defining how to write the value.
+ f = The `FormatSpec` defining how to write the value.
*/
void formatValue(Writer, T, Char)(Writer w, T obj, ref FormatSpec!Char f)
if (is(Unqual!T == typeof(null)) && !is(T == enum) && !hasToString!(T, Char))
@@ -1367,12 +1367,12 @@ unittest
}
/**
-Integrals are formatted like $(D printf) does.
+Integrals are formatted like `printf` does.
Params:
- w = The $(D OutputRange) to write to.
+ w = The `OutputRange` to write to.
obj = The value to write.
- f = The $(D FormatSpec) defining how to write the value.
+ f = The `FormatSpec` defining how to write the value.
*/
void formatValue(Writer, T, Char)(Writer w, T obj, ref FormatSpec!Char f)
if (is(IntegralTypeOf!T) && !is(T == enum) && !hasToString!(T, Char))
@@ -1612,12 +1612,12 @@ unittest
}
/**
-Floating-point values are formatted like $(D printf) does.
+Floating-point values are formatted like `printf` does.
Params:
- w = The $(D OutputRange) to write to.
+ w = The `OutputRange` to write to.
obj = The value to write.
- f = The $(D FormatSpec) defining how to write the value.
+ f = The `FormatSpec` defining how to write the value.
*/
void formatValue(Writer, T, Char)(Writer w, T obj, ref FormatSpec!Char f)
if (is(FloatingPointTypeOf!T) && !is(T == enum) && !hasToString!(T, Char))
@@ -1766,12 +1766,12 @@ unittest
}
/*
-Formatting a $(D creal) is deprecated but still kept around for a while.
+Formatting a `creal` is deprecated but still kept around for a while.
Params:
- w = The $(D OutputRange) to write to.
+ w = The `OutputRange` to write to.
obj = The value to write.
- f = The $(D FormatSpec) defining how to write the value.
+ f = The `FormatSpec` defining how to write the value.
*/
void formatValue(Writer, T, Char)(Writer w, T obj, ref FormatSpec!Char f)
if (is(Unqual!T : creal) && !is(T == enum) && !hasToString!(T, Char))
@@ -1822,12 +1822,12 @@ unittest
}
/*
- Formatting an $(D ireal) is deprecated but still kept around for a while.
+ Formatting an `ireal` is deprecated but still kept around for a while.
Params:
- w = The $(D OutputRange) to write to.
+ w = The `OutputRange` to write to.
obj = The value to write.
- f = The $(D FormatSpec) defining how to write the value.
+ f = The `FormatSpec` defining how to write the value.
*/
void formatValue(Writer, T, Char)(Writer w, T obj, ref FormatSpec!Char f)
if (is(Unqual!T : ireal) && !is(T == enum) && !hasToString!(T, Char))
@@ -1867,14 +1867,14 @@ unittest
}
/**
-Individual characters ($(D char), $(D wchar), or $(D dchar)) are formatted as
+Individual characters (`char`, `wchar`, or `dchar`) are formatted as
Unicode characters with %s and as integers with integral-specific format
specs.
Params:
- w = The $(D OutputRange) to write to.
+ w = The `OutputRange` to write to.
obj = The value to write.
- f = The $(D FormatSpec) defining how to write the value.
+ f = The `FormatSpec` defining how to write the value.
*/
void formatValue(Writer, T, Char)(Writer w, T obj, ref FormatSpec!Char f)
if (is(CharTypeOf!T) && !is(T == enum) && !hasToString!(T, Char))
@@ -1942,12 +1942,12 @@ unittest
}
/**
-Strings are formatted like $(D printf) does.
+Strings are formatted like `printf` does.
Params:
- w = The $(D OutputRange) to write to.
+ w = The `OutputRange` to write to.
obj = The value to write.
- f = The $(D FormatSpec) defining how to write the value.
+ f = The `FormatSpec` defining how to write the value.
*/
void formatValue(Writer, T, Char)(Writer w, T obj, ref FormatSpec!Char f)
if (is(StringTypeOf!T) && !is(StaticArrayTypeOf!T) && !is(T == enum) && !hasToString!(T, Char))
@@ -2021,9 +2021,9 @@ unittest
Static-size arrays are formatted as dynamic arrays.
Params:
- w = The $(D OutputRange) to write to.
+ w = The `OutputRange` to write to.
obj = The value to write.
- f = The $(D FormatSpec) defining how to write the value.
+ f = The `FormatSpec` defining how to write the value.
*/
void formatValue(Writer, T, Char)(Writer w, auto ref T obj, ref FormatSpec!Char f)
if (is(StaticArrayTypeOf!T) && !is(T == enum) && !hasToString!(T, Char))
@@ -2060,13 +2060,13 @@ unittest // Test for issue 8310
Dynamic arrays are formatted as input ranges.
Specializations:
- $(UL $(LI $(D void[]) is formatted like $(D ubyte[]).)
+ $(UL $(LI `void[]` is formatted like `ubyte[]`.)
$(LI Const array is converted to input range by removing its qualifier.))
Params:
- w = The $(D OutputRange) to write to.
+ w = The `OutputRange` to write to.
obj = The value to write.
- f = The $(D FormatSpec) defining how to write the value.
+ f = The `FormatSpec` defining how to write the value.
*/
void formatValue(Writer, T, Char)(Writer w, T obj, ref FormatSpec!Char f)
if (is(DynamicArrayTypeOf!T) && !is(StringTypeOf!T) && !is(T == enum) && !hasToString!(T, Char))
@@ -2600,13 +2600,13 @@ if (!is(StringTypeOf!T) && !is(CharTypeOf!T) || is(T == enum))
}
/**
- Associative arrays are formatted by using $(D ':') and $(D ", ") as
- separators, and enclosed by $(D '[') and $(D ']').
+ Associative arrays are formatted by using `':'` and $(D ", ") as
+ separators, and enclosed by `'['` and `']'`.
Params:
- w = The $(D OutputRange) to write to.
+ w = The `OutputRange` to write to.
obj = The value to write.
- f = The $(D FormatSpec) defining how to write the value.
+ f = The `FormatSpec` defining how to write the value.
*/
void formatValue(Writer, T, Char)(Writer w, T obj, ref FormatSpec!Char f)
if (is(AssocArrayTypeOf!T) && !is(T == enum) && !hasToString!(T, Char))
@@ -2828,9 +2828,9 @@ unittest
}
/**
- Aggregates ($(D struct), $(D union), $(D class), and $(D interface)) are
- basically formatted by calling $(D toString).
- $(D toString) should have one of the following signatures:
+ Aggregates (`struct`, `union`, `class`, and `interface`) are
+ basically formatted by calling `toString`.
+ `toString` should have one of the following signatures:
---
const void toString(scope void delegate(const(char)[]) sink, FormatSpec fmt);
@@ -2840,11 +2840,11 @@ const string toString();
---
For the class objects which have input range interface,
- $(UL $(LI If the instance $(D toString) has overridden
- $(D Object.toString), it is used.)
+ $(UL $(LI If the instance `toString` has overridden
+ `Object.toString`, it is used.)
$(LI Otherwise, the objects are formatted as input range.))
- For the struct and union objects which does not have $(D toString),
+ For the struct and union objects which does not have `toString`,
$(UL $(LI If they have range interface, formatted as input range.)
$(LI Otherwise, they are formatted like $(D Type(field1, filed2, ...)).))
@@ -2892,7 +2892,7 @@ if (is(T == class) && !is(T == enum))
}
/++
- $(D formatValue) allows to reuse existing format specifiers:
+ `formatValue` allows to reuse existing format specifiers:
+/
unittest
{
@@ -2919,7 +2919,7 @@ unittest
}
/++
- The following code compares the use of $(D formatValue) and $(D formattedWrite).
+ The following code compares the use of `formatValue` and `formattedWrite`.
+/
unittest
{
@@ -3207,12 +3207,12 @@ unittest
}
/**
-$(D enum) is formatted like its base value.
+`enum` is formatted like its base value.
Params:
- w = The $(D OutputRange) to write to.
+ w = The `OutputRange` to write to.
val = The value to write.
- f = The $(D FormatSpec) defining how to write the value.
+ f = The `FormatSpec` defining how to write the value.
*/
void formatValue(Writer, T, Char)(Writer w, T val, ref FormatSpec!Char f)
if (is(T == enum))
@@ -5006,22 +5006,22 @@ private TypeInfo primitiveTypeInfo(Mangle m)
* The variadic arguments are consumed in order. Each is formatted
* into a sequence of chars, using the default format specification
* for its type, and the characters are sequentially passed to putc.
- * If a $(D char[]), $(D wchar[]), or $(D dchar[]) argument is
+ * If a `char[]`, `wchar[]`, or `dchar[]` argument is
* encountered, it is interpreted as a format string. As many
* arguments as specified in the format string are consumed and
* formatted according to the format specifications in that string and
* passed to putc. If there are too few remaining arguments, a
- * $(D FormatException) is thrown. If there are more remaining arguments than
+ * `FormatException` is thrown. If there are more remaining arguments than
* needed by the format specification, the default processing of
* arguments resumes until they are all consumed.
*
* Params:
* putc = Output is sent do this delegate, character by character.
- * arguments = Array of $(D TypeInfo)s, one for each argument to be formatted.
+ * arguments = Array of `TypeInfo`s, one for each argument to be formatted.
* argptr = Points to variadic argument list.
*
* Throws:
- * Mismatched arguments and formats result in a $(D FormatException) being thrown.
+ * Mismatched arguments and formats result in a `FormatException` being thrown.
*
* Format_String:
* $(I Format strings)
@@ -6594,7 +6594,7 @@ unittest
/*****************************************************
* Format arguments into buffer buf which must be large
* enough to hold the result. Throws RangeError if it is not.
- * Returns: The slice of $(D buf) containing the formatted string.
+ * Returns: The slice of `buf` containing the formatted string.
*
* $(RED sformat's current implementation has been replaced with $(LREF xsformat)'s
* implementation. in November 2012.
diff --git a/std/functional.d b/std/functional.d
index 53411d5459a..4c334ce4986 100644
--- a/std/functional.d
+++ b/std/functional.d
@@ -54,9 +54,9 @@ private template needOpCallAlias(alias fun)
/**
Transforms a string representing an expression into a unary
-function. The string must either use symbol name $(D a) as
-the parameter or provide the symbol via the $(D parmName) argument.
-If $(D fun) is not a string, $(D unaryFun) aliases itself away to $(D fun).
+function. The string must either use symbol name `a` as
+the parameter or provide the symbol via the `parmName` argument.
+If `fun` is not a string, `unaryFun` aliases itself away to `fun`.
*/
template unaryFun(alias fun, string parmName = "a")
@@ -144,10 +144,10 @@ unittest
/**
Transforms a string representing an expression into a binary function. The
-string must either use symbol names $(D a) and $(D b) as the parameters or
-provide the symbols via the $(D parm1Name) and $(D parm2Name) arguments.
-If $(D fun) is not a string, $(D binaryFun) aliases itself away to
-$(D fun).
+string must either use symbol names `a` and `b` as the parameters or
+provide the symbols via the `parm1Name` and `parm2Name` arguments.
+If `fun` is not a string, `binaryFun` aliases itself away to
+`fun`.
*/
template binaryFun(alias fun, string parm1Name = "a",
@@ -268,7 +268,7 @@ private uint _ctfeSkipName(ref string op, string name)
return 0;
}
-// returns 1 if $(D fun) is trivial unary function
+// returns 1 if `fun` is trivial unary function
private uint _ctfeMatchUnary(string fun, string name)
{
if (!__ctfe) assert(false);
@@ -316,7 +316,7 @@ unittest
static assert(_ctfeMatchUnary("ё[21]", "ё"));
}
-// returns 1 if $(D fun) is trivial binary function
+// returns 1 if `fun` is trivial binary function
private uint _ctfeMatchBinary(string fun, string name1, string name2)
{
if (!__ctfe) assert(false);
@@ -554,7 +554,7 @@ unittest
}
/**
-Negates predicate $(D pred).
+Negates predicate `pred`.
*/
template not(alias pred)
{
@@ -643,7 +643,7 @@ template partial(alias fun, alias arg)
}
/**
-Deprecated alias for $(D partial), kept for backwards compatibility
+Deprecated alias for `partial`, kept for backwards compatibility
*/
deprecated("Please use std.functional.partial instead")
@@ -749,7 +749,7 @@ functions.
Note: In the special case where where only a single function is provided
($(D F.length == 1)), adjoin simply aliases to the single passed function
-($(D F[0])).
+(`F[0]`).
*/
template adjoin(F...) if (F.length == 1)
{
@@ -875,7 +875,7 @@ unittest
/**
Composes passed-in functions $(D fun[0], fun[1], ...) returning a
- function $(D f(x)) that in turn returns $(D
+ function `f(x)` that in turn returns $(D
fun[0](fun[1](...(x)))...). Each function can be a regular
functions, a delegate, or a string.
@@ -970,8 +970,8 @@ unittest
}
----
-Technically the memoized function should be pure because $(D memoize) assumes it will
-always return the same result for a given tuple of arguments. However, $(D memoize) does not
+Technically the memoized function should be pure because `memoize` assumes it will
+always return the same result for a given tuple of arguments. However, `memoize` does not
enforce that because sometimes it
is useful to memoize an impure function, too.
*/
@@ -1072,8 +1072,8 @@ unittest
}
/**
- * This memoizes all values of $(D fact) up to the largest argument. To only cache the final
- * result, move $(D memoize) outside the function as shown below.
+ * This memoizes all values of `fact` up to the largest argument. To only cache the final
+ * result, move `memoize` outside the function as shown below.
*/
unittest
{
@@ -1086,7 +1086,7 @@ unittest
}
/**
- * When the $(D maxSize) parameter is specified, memoize will used
+ * When the `maxSize` parameter is specified, memoize will used
* a fixed size hash table to limit the number of cached entries.
*/
unittest
@@ -1222,7 +1222,7 @@ private struct DelegateFaker(F)
*
* BUGS:
* $(UL
- * $(LI Does not work with $(D @safe) functions.)
+ * $(LI Does not work with `@safe` functions.)
* $(LI Ignores C-style / D-style variadic arguments.)
* )
*/
diff --git a/std/getopt.d b/std/getopt.d
index 913ef7f1fbf..c39623a95e5 100644
--- a/std/getopt.d
+++ b/std/getopt.d
@@ -3,7 +3,7 @@
/**
Processing of command line options.
-The getopt module implements a $(D getopt) function, which adheres to
+The getopt module implements a `getopt` function, which adheres to
the POSIX syntax for command line options. GNU extensions are
supported in the form of long options introduced by a double dash
("--"). Support for bundling of command line options, as was the case
@@ -19,7 +19,7 @@ License: $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: $(WEB erdani.org, Andrei Alexandrescu)
Credits: This module and its documentation are inspired by Perl's $(WEB
perldoc.perl.org/Getopt/Long.html, Getopt::Long) module. The syntax of
- D's $(D getopt) is simpler than its Perl counterpart because $(D
+ D's `getopt` is simpler than its Perl counterpart because $(D
getopt) infers the expected parameter types from the static types of
the passed-in pointers.
Source: $(PHOBOSSRC std/_getopt.d)
@@ -37,7 +37,7 @@ import std.traits;
/**
* Thrown on one of the following conditions:
* - An unrecognized command-line argument is passed
- * and $(D std.getopt.config.passThrough) was not present.
+ * and `std.getopt.config.passThrough` was not present.
*/
class GetOptException : Exception
{
@@ -80,31 +80,31 @@ void main(string[] args)
}
---------
- The $(D getopt) function takes a reference to the command line
- (as received by $(D main)) as its first argument, and an
+ The `getopt` function takes a reference to the command line
+ (as received by `main`) as its first argument, and an
unbounded number of pairs of strings and pointers. Each string is an
option meant to "fill" the value pointed-to by the pointer to its
right (the "bound" pointer). The option string in the call to
- $(D getopt) should not start with a dash.
+ `getopt` should not start with a dash.
In all cases, the command-line options that were parsed and used by
- $(D getopt) are removed from $(D args). Whatever in the
- arguments did not look like an option is left in $(D args) for
+ `getopt` are removed from `args`. Whatever in the
+ arguments did not look like an option is left in `args` for
further processing by the program. Values that were unaffected by the
options are not touched, so a common idiom is to initialize options
- to their defaults and then invoke $(D getopt). If a
+ to their defaults and then invoke `getopt`. If a
command-line argument is recognized as an option with a parameter and
the parameter cannot be parsed properly (e.g. a number is expected
- but not present), a $(D ConvException) exception is thrown.
- If $(D std.getopt.config.passThrough) was not passed to getopt
- and an unrecognized command-line argument is found, a $(D GetOptException)
+ but not present), a `ConvException` exception is thrown.
+ If `std.getopt.config.passThrough` was not passed to getopt
+ and an unrecognized command-line argument is found, a `GetOptException`
is thrown.
- Depending on the type of the pointer being bound, $(D getopt)
+ Depending on the type of the pointer being bound, `getopt`
recognizes the following kinds of options:
$(OL
- $(LI $(I Boolean options). A lone argument sets the option to $(D true).
+ $(LI $(I Boolean options). A lone argument sets the option to `true`.
Additionally $(B true) or $(B false) can be set within the option separated
with an "=" sign:
@@ -113,11 +113,11 @@ void main(string[] args)
getopt(args, "verbose", &verbose, "debug", &debugging);
---------
- To set $(D verbose) to $(D true), invoke the program with either
- $(D --verbose) or $(D --verbose=true).
+ To set `verbose` to `true`, invoke the program with either
+ `--verbose` or `--verbose=true`.
- To set $(D debugging) to $(D false), invoke the program with
- $(D --debugging=false).
+ To set `debugging` to `false`, invoke the program with
+ `--debugging=false`.
)
$(LI $(I Numeric options.) If an option is bound to a numeric type, a
@@ -129,8 +129,8 @@ void main(string[] args)
getopt(args, "timeout", &timeout);
---------
- To set $(D timeout) to $(D 5), invoke the program with either
- $(D --timeout=5) or $(D --timeout 5).
+ To set `timeout` to `5`, invoke the program with either
+ `--timeout=5` or $(D --timeout 5).
)
$(LI $(I Incremental options.) If an option name has a "+" suffix and is
@@ -145,7 +145,7 @@ void main(string[] args)
Invoking the program with "--paranoid --paranoid --paranoid" will set $(D
paranoid) to 3. Note that an incremental option never expects a parameter,
e.g. in the command line "--paranoid 42 --paranoid", the "42" does not set
- $(D paranoid) to 42; instead, $(D paranoid) is set to 2 and "42" is not
+ `paranoid` to 42; instead, `paranoid` is set to 2 and "42" is not
considered as part of the normal program arguments.
)
@@ -159,8 +159,8 @@ void main(string[] args)
getopt(args, "color", &color);
---------
- To set $(D color) to $(D Color.yes), invoke the program with either
- $(D --color=yes) or $(D --color yes).
+ To set `color` to `Color.yes`, invoke the program with either
+ `--color=yes` or $(D --color yes).
)
$(LI $(I String options.) If an option is bound to a string, a string is
@@ -173,7 +173,7 @@ getopt(args, "output", &outputFile);
---------
Invoking the program with "--output=myfile.txt" or "--output myfile.txt"
- will set $(D outputFile) to "myfile.txt". If you want to pass a string
+ will set `outputFile` to "myfile.txt". If you want to pass a string
containing spaces, you need to use the quoting that is appropriate to your
shell, e.g. --output='my file.txt'.
)
@@ -187,7 +187,7 @@ getopt(args, "output", &outputFiles);
---------
Invoking the program with "--output=myfile.txt --output=yourfile.txt" or
- "--output myfile.txt --output yourfile.txt" will set $(D outputFiles) to
+ "--output myfile.txt --output yourfile.txt" will set `outputFiles` to
$(D [ "myfile.txt", "yourfile.txt" ]).
Alternatively you can set $(LREF arraySep) as the element separator:
@@ -211,7 +211,7 @@ getopt(args, "tune", &tuningParms);
---------
Invoking the program with e.g. "--tune=alpha=0.5 --tune beta=0.6" will set
- $(D tuningParms) to [ "alpha" : 0.5, "beta" : 0.6 ].
+ `tuningParms` to [ "alpha" : 0.5, "beta" : 0.6 ].
Alternatively you can set $(LREF arraySep) as the element separator:
@@ -309,7 +309,7 @@ getopt(args, "verbose|loquacious|garrulous", &verbose);
$(B Case)
By default options are case-insensitive. You can change that behavior
-by passing $(D getopt) the $(D caseSensitive) directive like this:
+by passing `getopt` the `caseSensitive` directive like this:
---------
bool foo, bar;
@@ -320,8 +320,8 @@ getopt(args,
---------
In the example above, "--foo", "--bar", "--FOo", "--bAr" etc. are recognized.
-The directive is active til the end of $(D getopt), or until the
-converse directive $(D caseInsensitive) is encountered:
+The directive is active til the end of `getopt`, or until the
+converse directive `caseInsensitive` is encountered:
---------
bool foo, bar;
@@ -341,8 +341,8 @@ option "bar" was parsed.
$(B "Short" versus "long" options)
Traditionally, programs accepted single-letter options preceded by
-only one dash (e.g. $(D -t)). $(D getopt) accepts such parameters
-seamlessly. When used with a double-dash (e.g. $(D --t)), a
+only one dash (e.g. `-t`). `getopt` accepts such parameters
+seamlessly. When used with a double-dash (e.g. `--t`), a
single-letter option behaves the same as a multi-letter option. When
used with a single dash, a single-letter option is accepted. If the
option has a parameter, that must be "stuck" to the option without
@@ -353,9 +353,9 @@ uint timeout;
getopt(args, "timeout|t", &timeout);
---------
-To set $(D timeout) to $(D 5), use either of the following: $(D --timeout=5),
-$(D --timeout 5), $(D --t=5), $(D --t 5), or $(D -t5). Forms such as $(D -t 5)
-and $(D -timeout=5) will be not accepted.
+To set `timeout` to `5`, use either of the following: `--timeout=5`,
+$(D --timeout 5), `--t=5`, $(D --t 5), or `-t5`. Forms such as $(D -t 5)
+and `-timeout=5` will be not accepted.
For more details about short options, refer also to the next section.
@@ -363,7 +363,7 @@ $(B Bundling)
Single-letter options can be bundled together, i.e. "-abc" is the same as
$(D "-a -b -c"). By default, this option is turned off. You can turn it on
-with the $(D std.getopt.config.bundling) directive:
+with the `std.getopt.config.bundling` directive:
---------
bool foo, bar;
@@ -374,7 +374,7 @@ getopt(args,
---------
In case you want to only enable bundling for some of the parameters,
-bundling can be turned off with $(D std.getopt.config.noBundling).
+bundling can be turned off with `std.getopt.config.noBundling`.
$(B Required)
@@ -389,14 +389,14 @@ getopt(args,
"bar|b", &bar);
---------
-Only the option direclty following $(D std.getopt.config.required) is
+Only the option direclty following `std.getopt.config.required` is
required.
$(B Passing unrecognized options through)
If an application needs to do its own processing of whichever arguments
-$(D getopt) did not understand, it can pass the
-$(D std.getopt.config.passThrough) directive to $(D getopt):
+`getopt` did not understand, it can pass the
+`std.getopt.config.passThrough` directive to `getopt`:
---------
bool foo, bar;
@@ -407,22 +407,22 @@ getopt(args,
---------
An unrecognized option such as "--baz" will be found untouched in
-$(D args) after $(D getopt) returns.
+`args` after `getopt` returns.
$(D Help Information Generation)
If an option string is followed by another string, this string serves as an
-description for this option. The function $(D getopt) returns a struct of type
-$(D GetoptResult). This return value contains information about all passed options
+description for this option. The function `getopt` returns a struct of type
+`GetoptResult`. This return value contains information about all passed options
as well a bool indicating if information about these options where required by
the passed arguments.
$(B Options Terminator)
-A lonesome double-dash terminates $(D getopt) gathering. It is used to
+A lonesome double-dash terminates `getopt` gathering. It is used to
separate program options from other parameters (e.g. options to be passed
to another program). Invoking the example above with $(D "--foo -- --bar")
-parses foo but leaves "--bar" in $(D args). The double-dash itself is
+parses foo but leaves "--bar" in `args`. The double-dash itself is
removed from the argument array.
*/
GetoptResult getopt(T...)(ref string[] args, T opts)
@@ -456,9 +456,9 @@ unittest
}
/**
- Configuration options for $(D getopt).
+ Configuration options for `getopt`.
- You can pass them to $(D getopt) in any position, except in between an option
+ You can pass them to `getopt` in any position, except in between an option
string and its bound pointer.
*/
enum config {
@@ -480,18 +480,18 @@ enum config {
required
}
-/** The result of the $(D getopt) function.
+/** The result of the `getopt` function.
-The $(D GetoptResult) contains two members. The first member is a boolean with
-the name $(D helpWanted). The second member is an array of $(D Option). The
-array is accessable by the name $(D options).
+The `GetoptResult` contains two members. The first member is a boolean with
+the name `helpWanted`. The second member is an array of `Option`. The
+array is accessable by the name `options`.
*/
struct GetoptResult {
bool helpWanted; /// Flag indicating if help was requested
Option[] options; /// All possible options
}
-/** The result of the $(D getoptHelp) function.
+/** The result of the `getoptHelp` function.
*/
struct Option {
string optShort; /// The short symbol for this option
@@ -850,22 +850,22 @@ unittest
/**
The option character (default '-').
- Defaults to '-' but it can be assigned to prior to calling $(D getopt).
+ Defaults to '-' but it can be assigned to prior to calling `getopt`.
*/
dchar optionChar = '-';
/**
The string that conventionally marks the end of all options (default '--').
- Defaults to "--" but can be assigned to prior to calling $(D getopt). Assigning an
- empty string to $(D endOfOptions) effectively disables it.
+ Defaults to "--" but can be assigned to prior to calling `getopt`. Assigning an
+ empty string to `endOfOptions` effectively disables it.
*/
string endOfOptions = "--";
/**
The assignment character used in options with parameters (default '=').
- Defaults to '=' but can be assigned to prior to calling $(D getopt).
+ Defaults to '=' but can be assigned to prior to calling `getopt`.
*/
dchar assignChar = '=';
@@ -873,7 +873,7 @@ dchar assignChar = '=';
The string used to separate the elements of an array or associative array
(default is "" which means the elements are separated by whitespace).
- Defaults to "" but can be assigned to prior to calling $(D getopt).
+ Defaults to "" but can be assigned to prior to calling `getopt`.
*/
string arraySep = "";
@@ -1345,13 +1345,13 @@ unittest
assert(args == ["program", "--option"]);
}
-/** This function prints the passed $(D Option) and text in an aligned manner.
+/** This function prints the passed `Option` and text in an aligned manner.
The passed text will be printed first, followed by a newline. Than the short
and long version of every option will be printed. The short and long version
-will be aligned to the longest option of every $(D Option) passed. If a help
+will be aligned to the longest option of every `Option` passed. If a help
message is present it will be printed after the long version of the
-$(D Option).
+`Option`.
------------
foreach(it; opt)
@@ -1363,7 +1363,7 @@ foreach(it; opt)
Params:
text = The text to printed at the beginning of the help output.
- opt = The $(D Option) extracted from the $(D getopt) parameter.
+ opt = The `Option` extracted from the `getopt` parameter.
*/
void defaultGetoptPrinter(string text, Option[] opt)
{
@@ -1372,14 +1372,14 @@ void defaultGetoptPrinter(string text, Option[] opt)
defaultGetoptFormatter(stdout.lockingTextWriter(), text, opt);
}
-/** This function writes the passed text and $(D Option) into an output range
+/** This function writes the passed text and `Option` into an output range
in the manner, described in the documentation of function
-$(D defaultGetoptPrinter).
+`defaultGetoptPrinter`.
Params:
output = The output range used to write the help information.
text = The text to printed at the beginning of the help output.
- opt = The $(D Option) extracted from the $(D getopt) parameter.
+ opt = The `Option` extracted from the `getopt` parameter.
*/
void defaultGetoptFormatter(Output)(Output output, string text, Option[] opt)
{
diff --git a/std/internal/cstring.d b/std/internal/cstring.d
index 344210a402c..82e3e7aa14c 100644
--- a/std/internal/cstring.d
+++ b/std/internal/cstring.d
@@ -32,7 +32,7 @@ License: $(HTTP boost.org/LICENSE_1_0.txt, Boost License 1.0).
Authors: Denis Shelomovskij
Macros:
-COREREF = $(HTTP dlang.org/phobos/core_$1.html#$2, $(D core.$1.$2))
+COREREF = $(HTTP dlang.org/phobos/core_$1.html#$2, `core.$1.$2`)
*/
module std.internal.cstring;
@@ -55,8 +55,8 @@ body
Creates temporary $(I C string) with copy of passed text.
Returned object is implicitly convertible to $(D const To*) and
-has two properties: $(D ptr) to access $(I C string) as $(D const To*)
-and $(D buffPtr) to access it as $(D To*).
+has two properties: `ptr` to access $(I C string) as $(D const To*)
+and `buffPtr` to access it as `To*`.
The temporary $(I C string) is valid unless returned object is destroyed.
Thus if returned object is assigned to a variable the temporary is
@@ -67,7 +67,7 @@ primary expression.
Implementation_note:
For small strings tempCString will use stack allocated buffer,
for large strings (approximately 250 characters and more) it will
-allocate temporary one using C's $(D malloc).
+allocate temporary one using C's `malloc`.
Note:
This function is intended to be used in function call expression (like
@@ -211,13 +211,13 @@ pure nothrow @nogc unittest
/**
-Copies text from $(D source) to $(D buff) performing conversion
+Copies text from `source` to `buff` performing conversion
to different Unicode Transformation Format if needed.
-$(D buff) must be large enough to hold the result.
+`buff` must be large enough to hold the result.
Returns:
-Slice of the provided buffer $(D buff) with the copy of $(D source).
+Slice of the provided buffer `buff` with the copy of `source`.
*/
To[] copyEncoded(To, From)(in From[] source, To[] buff) @trusted nothrow @nogc
if(isSomeChar!To && isSomeChar!From)
diff --git a/std/internal/scopebuffer.d b/std/internal/scopebuffer.d
index 67323e25b85..13f0ee46a4f 100644
--- a/std/internal/scopebuffer.d
+++ b/std/internal/scopebuffer.d
@@ -74,11 +74,11 @@ string cat(string s1, string s2)
return textbuf[].idup;
}
---
- * ScopeBuffer is intended for high performance usages in $(D @system) and $(D @trusted) code.
+ * ScopeBuffer is intended for high performance usages in `@system` and `@trusted` code.
* It is designed to fit into two 64 bit registers, again for high performance use.
* If used incorrectly, memory leaks and corruption can result. Be sure to use
* $(D scope(exit) textbuf.free();) for proper cleanup, and do not refer to a ScopeBuffer
- * instance's contents after $(D ScopeBuffer.free()) has been called.
+ * instance's contents after `ScopeBuffer.free()` has been called.
*
* The realloc parameter defaults to C's realloc(). Another can be supplied to override it.
*
@@ -175,8 +175,8 @@ struct ScopeBuffer(T, alias realloc = /*core.stdc.stdlib*/.realloc)
/************************
* Append array s to the buffer.
*
- * If $(D const(T)) can be converted to $(D T), then put will accept
- * $(D const(T)[]) as input. It will accept a $(D T[]) otherwise.
+ * If `const(T)` can be converted to `T`, then put will accept
+ * `const(T)[]` as input. It will accept a `T[]` otherwise.
*/
private alias CT = Select!(is(const(T) : T), const(T), T);
/// ditto
diff --git a/std/json.d b/std/json.d
index a5579560553..ae5f298cead 100644
--- a/std/json.d
+++ b/std/json.d
@@ -63,7 +63,7 @@ JSON type enumeration
*/
enum JSON_TYPE : byte
{
- /// Indicates the type of a $(D JSONValue).
+ /// Indicates the type of a `JSONValue`.
NULL,
STRING, /// ditto
INTEGER, /// ditto
@@ -112,10 +112,10 @@ struct JSONValue
/**
$(RED Deprecated. Instead, please assign the value with the adequate
- type to $(D JSONValue) directly. This will be removed in
+ type to `JSONValue` directly. This will be removed in
June 2015.)
- Sets the _type of this $(D JSONValue). Previous content is cleared.
+ Sets the _type of this `JSONValue`. Previous content is cleared.
*/
deprecated("Please assign the value with the adequate type to JSONValue directly.")
@property JSON_TYPE type(JSON_TYPE newType)
@@ -154,7 +154,7 @@ struct JSONValue
}
/// Value getter/setter for $(D JSON_TYPE.STRING).
- /// Throws $(D JSONException) for read access if $(D type) is not $(D JSON_TYPE.STRING).
+ /// Throws `JSONException` for read access if `type` is not $(D JSON_TYPE.STRING).
@property inout(string) str() inout
{
enforce!JSONException(type == JSON_TYPE.STRING,
@@ -183,7 +183,7 @@ struct JSONValue
}
/// Value getter/setter for $(D JSON_TYPE.INTEGER).
- /// Throws $(D JSONException) for read access if $(D type) is not $(D JSON_TYPE.INTEGER).
+ /// Throws `JSONException` for read access if `type` is not $(D JSON_TYPE.INTEGER).
@property inout(long) integer() inout
{
enforce!JSONException(type == JSON_TYPE.INTEGER,
@@ -198,7 +198,7 @@ struct JSONValue
}
/// Value getter/setter for $(D JSON_TYPE.UINTEGER).
- /// Throws $(D JSONException) for read access if $(D type) is not $(D JSON_TYPE.UINTEGER).
+ /// Throws `JSONException` for read access if `type` is not $(D JSON_TYPE.UINTEGER).
@property inout(ulong) uinteger() inout
{
enforce!JSONException(type == JSON_TYPE.UINTEGER,
@@ -213,7 +213,7 @@ struct JSONValue
}
/// Value getter/setter for $(D JSON_TYPE.FLOAT).
- /// Throws $(D JSONException) for read access if $(D type) is not $(D JSON_TYPE.FLOAT).
+ /// Throws `JSONException` for read access if `type` is not $(D JSON_TYPE.FLOAT).
@property inout(double) floating() inout
{
enforce!JSONException(type == JSON_TYPE.FLOAT,
@@ -228,7 +228,7 @@ struct JSONValue
}
/// Value getter/setter for $(D JSON_TYPE.OBJECT).
- /// Throws $(D JSONException) for read access if $(D type) is not $(D JSON_TYPE.OBJECT).
+ /// Throws `JSONException` for read access if `type` is not $(D JSON_TYPE.OBJECT).
@property ref inout(JSONValue[string]) object() inout
{
enforce!JSONException(type == JSON_TYPE.OBJECT,
@@ -243,7 +243,7 @@ struct JSONValue
}
/// Value getter/setter for $(D JSON_TYPE.ARRAY).
- /// Throws $(D JSONException) for read access if $(D type) is not $(D JSON_TYPE.ARRAY).
+ /// Throws `JSONException` for read access if `type` is not $(D JSON_TYPE.ARRAY).
@property ref inout(JSONValue[]) array() inout
{
enforce!JSONException(type == JSON_TYPE.ARRAY,
@@ -351,15 +351,15 @@ struct JSONValue
}
/**
- * Constructor for $(D JSONValue). If $(D arg) is a $(D JSONValue)
- * its value and type will be copied to the new $(D JSONValue).
+ * Constructor for `JSONValue`. If `arg` is a `JSONValue`
+ * its value and type will be copied to the new `JSONValue`.
* Note that this is a shallow copy: if type is $(D JSON_TYPE.OBJECT)
* or $(D JSON_TYPE.ARRAY) then only the reference to the data will
* be copied.
- * Otherwise, $(D arg) must be implicitly convertible to one of the
- * following types: $(D typeof(null)), $(D string), $(D ulong),
- * $(D long), $(D double), an associative array $(D V[K]) for any $(D V)
- * and $(D K) i.e. a JSON object, any array or $(D bool). The type will
+ * Otherwise, `arg` must be implicitly convertible to one of the
+ * following types: `typeof(null)`, `string`, `ulong`,
+ * `long`, `double`, an associative array `V[K]` for any `V`
+ * and `K` i.e. a JSON object, any array or `bool`. The type will
* be set accordingly.
*/
this(T)(T arg) if(!isStaticArray!T)
@@ -401,7 +401,7 @@ struct JSONValue
}
/// Array syntax for json arrays.
- /// Throws $(D JSONException) if $(D type) is not $(D JSON_TYPE.ARRAY).
+ /// Throws `JSONException` if `type` is not $(D JSON_TYPE.ARRAY).
ref inout(JSONValue) opIndex(size_t i) inout
{
enforce!JSONException(type == JSON_TYPE.ARRAY,
@@ -419,7 +419,7 @@ struct JSONValue
}
/// Hash syntax for json objects.
- /// Throws $(D JSONException) if $(D type) is not $(D JSON_TYPE.OBJECT).
+ /// Throws `JSONException` if `type` is not $(D JSON_TYPE.OBJECT).
ref inout(JSONValue) opIndex(string k) inout
{
enforce!JSONException(type == JSON_TYPE.OBJECT,
@@ -434,10 +434,10 @@ struct JSONValue
assert( j["language"].str() == "D" );
}
- /// Operator sets $(D value) for element of JSON object by $(D key)
+ /// Operator sets `value` for element of JSON object by `key`
/// If JSON value is null, then operator initializes it with object and then
- /// sets $(D value) for it.
- /// Throws $(D JSONException) if $(D type) is not $(D JSON_TYPE.OBJECT)
+ /// sets `value` for it.
+ /// Throws `JSONException` if `type` is not $(D JSON_TYPE.OBJECT)
/// or $(D JSON_TYPE.NULL).
void opIndexAssign(T)(auto ref T value, string key)
{
@@ -530,7 +530,7 @@ struct JSONValue
string a = ("author" in j).str;
}
- /// Implements the foreach $(D opApply) interface for json arrays.
+ /// Implements the foreach `opApply` interface for json arrays.
int opApply(int delegate(size_t index, ref JSONValue) dg)
{
enforce!JSONException(type == JSON_TYPE.ARRAY,
@@ -547,7 +547,7 @@ struct JSONValue
return result;
}
- /// Implements the foreach $(D opApply) interface for json objects.
+ /// Implements the foreach `opApply` interface for json objects.
int opApply(int delegate(string key, ref JSONValue) dg)
{
enforce!JSONException(type == JSON_TYPE.OBJECT,
@@ -564,13 +564,13 @@ struct JSONValue
return result;
}
- /// Implicitly calls $(D toJSON) on this JSONValue.
+ /// Implicitly calls `toJSON` on this JSONValue.
string toString() const
{
return toJSON(&this);
}
- /// Implicitly calls $(D toJSON) on this JSONValue, like $(D toString), but
+ /// Implicitly calls `toJSON` on this JSONValue, like `toString`, but
/// also passes $(I true) as $(I pretty) argument.
string toPrettyString() const
{
@@ -876,8 +876,8 @@ Takes a tree of JSON values and returns the serialized string.
Any Object types will be serialized in a key-sorted order.
-If $(D pretty) is false no whitespaces are generated.
-If $(D pretty) is true serialized string is formatted to be human-readable.
+If `pretty` is false no whitespaces are generated.
+If `pretty` is true serialized string is formatted to be human-readable.
*/
string toJSON(in JSONValue* root, in bool pretty = false)
{
diff --git a/std/math.d b/std/math.d
index 9156ef8a03f..4429b67f455 100644
--- a/std/math.d
+++ b/std/math.d
@@ -3,7 +3,7 @@
/**
* Contains the elementary mathematical functions (powers, roots,
* and trigonometric functions), and low-level floating-point operations.
- * Mathematical special functions are available in $(D std.mathspecial).
+ * Mathematical special functions are available in `std.mathspecial`.
*
$(SCRIPT inhibitQuickIndex = 1;)
@@ -2434,7 +2434,7 @@ unittest
* Extracts the exponent of x as a signed integral value.
*
* If x is not a special value, the result is the same as
- * $(D cast(int)logb(x)).
+ * `cast(int)logb(x)`.
*
* $(TABLE_SV
* $(TR $(TH x) $(TH ilogb(x)) $(TH Range error?))
@@ -4920,7 +4920,7 @@ R copysign(R, X)(X to, R from) @trusted pure nothrow @nogc
}
/*********************************
-Returns $(D -1) if $(D x < 0), $(D x) if $(D x == 0), $(D 1) if
+Returns `-1` if $(D x < 0), `x` if $(D x == 0), `1` if
$(D x > 0), and $(NAN) if x==$(NAN).
*/
F sgn(F)(F x) @safe pure nothrow @nogc
@@ -6404,13 +6404,13 @@ body
}
/**
- Computes whether $(D lhs) is approximately equal to $(D rhs)
- admitting a maximum relative difference $(D maxRelDiff) and a
- maximum absolute difference $(D maxAbsDiff).
+ Computes whether `lhs` is approximately equal to `rhs`
+ admitting a maximum relative difference `maxRelDiff` and a
+ maximum absolute difference `maxAbsDiff`.
- If the two inputs are ranges, $(D approxEqual) returns true if and
+ If the two inputs are ranges, `approxEqual` returns true if and
only if the ranges have the same number of elements and if $(D
- approxEqual) evaluates to $(D true) for each pair of elements.
+ approxEqual) evaluates to `true` for each pair of elements.
*/
bool approxEqual(T, U, V)(T lhs, U rhs, V maxRelDiff, V maxAbsDiff = 1e-5)
{
diff --git a/std/net/curl.d b/std/net/curl.d
index fd4644dfe87..b1e449cba5d 100644
--- a/std/net/curl.d
+++ b/std/net/curl.d
@@ -32,7 +32,7 @@ $(LINK2 http://dlang.org/download.html, download page).
Compared to using libcurl directly this module allows simpler client code for
common uses, requires no unsafe operations, and integrates better with the rest
-of the language. Futhermore it provides $(D range)
+of the language. Futhermore it provides `range`
access to protocols supported by libcurl both synchronously and asynchronously.
A high level and a low level API are available. The high level API is built
@@ -40,7 +40,7 @@ entirely on top of the low level one.
The high level API is for commonly used functionality such as HTTP/FTP get. The
$(LREF byLineAsync) and $(LREF byChunkAsync) provides asynchronous $(D ranges) that performs the request in another
+href="std_range.html">`ranges` that performs the request in another
thread while handling a line/chunk in the current thread.
The low level API allows for streaming and other advanced features.
@@ -86,9 +86,9 @@ dlang.org web page asynchronously.)
)
$(LEADINGROW Low level
)
-$(TR $(TDNW $(LREF HTTP)) $(TD $(D HTTP) struct for advanced usage))
-$(TR $(TDNW $(LREF FTP)) $(TD $(D FTP) struct for advanced usage))
-$(TR $(TDNW $(LREF SMTP)) $(TD $(D SMTP) struct for advanced usage))
+$(TR $(TDNW $(LREF HTTP)) $(TD `HTTP` struct for advanced usage))
+$(TR $(TDNW $(LREF FTP)) $(TD `FTP` struct for advanced usage))
+$(TR $(TDNW $(LREF SMTP)) $(TD `SMTP` struct for advanced usage))
)
@@ -375,9 +375,9 @@ unittest
* conn = connection to use e.g. FTP or HTTP. The default AutoProtocol will
* guess connection type and create a new instance for this call only.
*
- * The template parameter $(D T) specifies the type to return. Possible values
- * are $(D char) and $(D ubyte) to return $(D char[]) or $(D ubyte[]). If asking
- * for $(D char), content will be converted from the connection character set
+ * The template parameter `T` specifies the type to return. Possible values
+ * are `char` and `ubyte` to return `char[]` or `ubyte[]`. If asking
+ * for `char`, content will be converted from the connection character set
* (specified in HTTP response headers or FTP connection properties, both ISO-8859-1
* by default) to UTF-8.
*
@@ -392,7 +392,7 @@ unittest
*
* Throws:
*
- * $(D CurlException) on error.
+ * `CurlException` on error.
*
* See_Also: $(LREF HTTP.Method)
*/
@@ -443,9 +443,9 @@ unittest
* conn = connection to use e.g. FTP or HTTP. The default AutoProtocol will
* guess connection type and create a new instance for this call only.
*
- * The template parameter $(D T) specifies the type to return. Possible values
- * are $(D char) and $(D ubyte) to return $(D char[]) or $(D ubyte[]). If asking
- * for $(D char), content will be converted from the connection character set
+ * The template parameter `T` specifies the type to return. Possible values
+ * are `char` and `ubyte` to return `char[]` or `ubyte[]`. If asking
+ * for `char`, content will be converted from the connection character set
* (specified in HTTP response headers or FTP connection properties, both ISO-8859-1
* by default) to UTF-8.
*
@@ -506,9 +506,9 @@ unittest
* conn = connection to use e.g. FTP or HTTP. The default AutoProtocol will
* guess connection type and create a new instance for this call only.
*
- * The template parameter $(D T) specifies the type to return. Possible values
- * are $(D char) and $(D ubyte) to return $(D char[]) or $(D ubyte[]). If asking
- * for $(D char), content will be converted from the connection character set
+ * The template parameter `T` specifies the type to return. Possible values
+ * are `char` and `ubyte` to return `char[]` or `ubyte[]`. If asking
+ * for `char`, content will be converted from the connection character set
* (specified in HTTP response headers or FTP connection properties, both ISO-8859-1
* by default) to UTF-8.
*
@@ -623,8 +623,8 @@ unittest
* conn = connection to use e.g. FTP or HTTP. The default AutoProtocol will
* guess connection type and create a new instance for this call only.
*
- * The template parameter $(D T) specifies the type to return. Possible values
- * are $(D char) and $(D ubyte) to return $(D char[]) or $(D ubyte[]).
+ * The template parameter `T` specifies the type to return. Possible values
+ * are `char` and `ubyte` to return `char[]` or `ubyte[]`.
* Currently the HTTP RFC does not specify any usage of the optionsData and
* for this reason the example below does not send optionsData to the server.
*
@@ -674,8 +674,8 @@ unittest
* conn = connection to use e.g. FTP or HTTP. The default AutoProtocol will
* guess connection type and create a new instance for this call only.
*
- * The template parameter $(D T) specifies the type to return. Possible values
- * are $(D char) and $(D ubyte) to return $(D char[]) or $(D ubyte[]).
+ * The template parameter `T` specifies the type to return. Possible values
+ * are `char` and `ubyte` to return `char[]` or `ubyte[]`.
*
* Example:
* ----
@@ -711,8 +711,8 @@ unittest
* conn = connection to use e.g. FTP or HTTP. The default AutoProtocol will
* guess connection type and create a new instance for this call only.
*
- * The template parameter $(D T) specifies the type to return. Possible values
- * are $(D char) and $(D ubyte) to return $(D char[]) or $(D ubyte[]).
+ * The template parameter `T` specifies the type to return. Possible values
+ * are `char` and `ubyte` to return `char[]` or `ubyte[]`.
*
* Example:
* ----
@@ -941,7 +941,7 @@ struct ByLineBuffer(Char)
/** HTTP/FTP fetch content as a range of lines.
*
* A range of lines is returned when the request is complete. If the method or
- * other request properties is to be customized then set the $(D conn) parameter
+ * other request properties is to be customized then set the `conn` parameter
* with a HTTP/FTP instance that has these properties set.
*
* Example:
@@ -1048,7 +1048,7 @@ unittest
/** HTTP/FTP fetch content as a range of chunks.
*
* A range of chunks is returned when the request is complete. If the method or
- * other request properties is to be customized then set the $(D conn) parameter
+ * other request properties is to be customized then set the `conn` parameter
* with a HTTP/FTP instance that has these properties set.
*
* Example:
@@ -1292,10 +1292,10 @@ static struct AsyncLineInputRange(Char)
*
* A range of lines is returned immediately and the request that fetches the
* lines is performed in another thread. If the method or other request
- * properties is to be customized then set the $(D conn) parameter with a
+ * properties is to be customized then set the `conn` parameter with a
* HTTP/FTP instance that has these properties set.
*
- * If $(D postData) is non-_null the method will be set to $(D post) for HTTP
+ * If `postData` is non-_null the method will be set to `post` for HTTP
* requests.
*
* The background thread will buffer up to transmitBuffers number of lines
@@ -1304,7 +1304,7 @@ static struct AsyncLineInputRange(Char)
* to receive more data from the network.
*
* If no data is available and the main thread accesses the range it will block
- * until data becomes available. An exception to this is the $(D wait(Duration)) method on
+ * until data becomes available. An exception to this is the `wait(Duration)` method on
* the $(LREF AsyncLineInputRange). This method will wait at maximum for the
* specified duration and return true if data is available.
*
@@ -1447,10 +1447,10 @@ static struct AsyncChunkInputRange
*
* A range of chunks is returned immediately and the request that fetches the
* chunks is performed in another thread. If the method or other request
- * properties is to be customized then set the $(D conn) parameter with a
+ * properties is to be customized then set the `conn` parameter with a
* HTTP/FTP instance that has these properties set.
*
- * If $(D postData) is non-_null the method will be set to $(D post) for HTTP
+ * If `postData` is non-_null the method will be set to `post` for HTTP
* requests.
*
* The background thread will buffer up to transmitBuffers number of chunks
@@ -1459,7 +1459,7 @@ static struct AsyncChunkInputRange
* thread to receive more data from the network.
*
* If no data is available and the main thread access the range it will block
- * until data becomes available. An exception to this is the $(D wait(Duration))
+ * until data becomes available. An exception to this is the `wait(Duration)`
* method on the $(LREF AsyncChunkInputRange). This method will wait at maximum for the specified
* duration and return true if data is available.
*
@@ -1619,7 +1619,7 @@ private void _asyncDuplicateConnection(Conn, PostData)
private mixin template Protocol()
{
- /// Value to return from $(D onSend)/$(D onReceive) delegates in order to
+ /// Value to return from `onSend`/`onReceive` delegates in order to
/// pause a request
alias requestPause = CurlReadFunc.pause;
@@ -1844,15 +1844,15 @@ private mixin template Protocol()
/**
* The event handler that gets called when data is needed for sending. The
- * length of the $(D void[]) specifies the maximum number of bytes that can
+ * length of the `void[]` specifies the maximum number of bytes that can
* be sent.
*
* Returns:
* The callback returns the number of elements in the buffer that have been
* filled and are ready to send.
- * The special value $(D .abortRequest) can be returned in order to abort the
+ * The special value `.abortRequest` can be returned in order to abort the
* current request.
- * The special value $(D .pauseRequest) can be returned in order to pause the
+ * The special value `.pauseRequest` can be returned in order to pause the
* current request.
*
* Example:
@@ -1939,8 +1939,8 @@ private mixin template Protocol()
}
/*
- Decode $(D ubyte[]) array using the provided EncodingScheme up to maxChars
- Returns: Tuple of ubytes read and the $(D Char[]) characters decoded.
+ Decode `ubyte[]` array using the provided EncodingScheme up to maxChars
+ Returns: Tuple of ubytes read and the `Char[]` characters decoded.
Not all ubytes are guaranteed to be read in case of decoding error.
*/
private Tuple!(size_t,Char[])
@@ -1965,7 +1965,7 @@ decodeString(Char = char)(const(ubyte)[] data,
}
/*
- Decode $(D ubyte[]) array using the provided $(D EncodingScheme) until a the
+ Decode `ubyte[]` array using the provided `EncodingScheme` until a the
line terminator specified is found. The basesrc parameter is effectively
prepended to src as the first thing.
@@ -2237,7 +2237,7 @@ struct HTTP
Perform a http request.
After the HTTP client has been setup and possibly assigned callbacks the
- $(D perform()) method will start performing the request towards the
+ `perform()` method will start performing the request towards the
specified server.
Params:
@@ -2297,7 +2297,7 @@ struct HTTP
// docs mixed in.
version (StdDdoc)
{
- /// Value to return from $(D onSend)/$(D onReceive) delegates in order to
+ /// Value to return from `onSend`/`onReceive` delegates in order to
/// pause a request
alias requestPause = CurlReadFunc.pause;
@@ -2422,15 +2422,15 @@ struct HTTP
/**
* The event handler that gets called when data is needed for sending. The
- * length of the $(D void[]) specifies the maximum number of bytes that can
+ * length of the `void[]` specifies the maximum number of bytes that can
* be sent.
*
* Returns:
* The callback returns the number of elements in the buffer that have been
* filled and are ready to send.
- * The special value $(D .abortRequest) can be returned in order to abort the
+ * The special value `.abortRequest` can be returned in order to abort the
* current request.
- * The special value $(D .pauseRequest) can be returned in order to pause the
+ * The special value `.pauseRequest` can be returned in order to pause the
* current request.
*
* Example:
@@ -2561,7 +2561,7 @@ struct HTTP
/** Set the value of the user agent request header field.
*
* By default a request has it's "User-Agent" field set to $(LREF
- * defaultUserAgent) even if $(D setUserAgent) was never called. Pass
+ * defaultUserAgent) even if `setUserAgent` was never called. Pass
* an empty string to suppress the "User-Agent" field altogether.
*/
void setUserAgent(const(char)[] userAgent)
@@ -2634,7 +2634,7 @@ struct HTTP
Set time condition on the request.
Params:
- cond = $(D CurlTimeCond.{none,ifmodsince,ifunmodsince,lastmod})
+ cond = `CurlTimeCond.{none,ifmodsince,ifunmodsince,lastmod}`
timestamp = Timestamp for the condition
$(WEB www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.25, _RFC2616 Section 14.25)
@@ -2732,7 +2732,7 @@ struct HTTP
* Set the event handler that receives incoming headers.
*
* The callback will receive a header field key, value as parameter. The
- * $(D const(char)[]) arrays are not valid after the delegate has returned.
+ * `const(char)[]` arrays are not valid after the delegate has returned.
*
* Example:
* ----
@@ -2753,7 +2753,7 @@ struct HTTP
Callback for each received StatusLine.
Notice that several callbacks can be done for each call to
- $(D perform()) due to redirections.
+ `perform()` due to redirections.
See_Also: $(LREF StatusLine)
*/
@@ -2965,7 +2965,7 @@ struct FTP
// docs mixed in.
version (StdDdoc)
{
- /// Value to return from $(D onSend)/$(D onReceive) delegates in order to
+ /// Value to return from `onSend`/`onReceive` delegates in order to
/// pause a request
alias requestPause = CurlReadFunc.pause;
@@ -3090,15 +3090,15 @@ struct FTP
/**
* The event handler that gets called when data is needed for sending. The
- * length of the $(D void[]) specifies the maximum number of bytes that can
+ * length of the `void[]` specifies the maximum number of bytes that can
* be sent.
*
* Returns:
* The callback returns the number of elements in the buffer that have been
* filled and are ready to send.
- * The special value $(D .abortRequest) can be returned in order to abort the
+ * The special value `.abortRequest` can be returned in order to abort the
* current request.
- * The special value $(D .pauseRequest) can be returned in order to pause the
+ * The special value `.pauseRequest` can be returned in order to pause the
* current request.
*
*/
@@ -3314,7 +3314,7 @@ struct SMTP
// docs mixed in.
version (StdDdoc)
{
- /// Value to return from $(D onSend)/$(D onReceive) delegates in order to
+ /// Value to return from `onSend`/`onReceive` delegates in order to
/// pause a request
alias requestPause = CurlReadFunc.pause;
@@ -3439,15 +3439,15 @@ struct SMTP
/**
* The event handler that gets called when data is needed for sending. The
- * length of the $(D void[]) specifies the maximum number of bytes that can
+ * length of the `void[]` specifies the maximum number of bytes that can
* be sent.
*
* Returns:
* The callback returns the number of elements in the buffer that have been
* filled and are ready to send.
- * The special value $(D .abortRequest) can be returned in order to abort the
+ * The special value `.abortRequest` can be returned in order to abort the
* current request.
- * The special value $(D .pauseRequest) can be returned in order to pause the
+ * The special value `.pauseRequest` can be returned in order to pause the
* current request.
*/
@property void onSend(size_t delegate(void[]) callback);
@@ -3567,7 +3567,7 @@ alias ThrowOnError = Flag!"throwOnError";
/**
Wrapper to provide a better interface to libcurl than using the plain C API.
- It is recommended to use the $(D HTTP)/$(D FTP) etc. structs instead unless
+ It is recommended to use the `HTTP`/`FTP` etc. structs instead unless
raw access to libcurl is needed.
Warning: This struct uses interior pointers for callbacks. Only allocate it
@@ -3710,7 +3710,7 @@ struct Curl
/**
Stop and invalidate this curl instance.
- Warning: Do not call this from inside a callback handler e.g. $(D onReceive).
+ Warning: Do not call this from inside a callback handler e.g. `onReceive`.
*/
void shutdown()
{
@@ -3821,7 +3821,7 @@ struct Curl
* The event handler that receives incoming data.
*
* Params:
- * callback = the callback that receives the $(D ubyte[]) data.
+ * callback = the callback that receives the `ubyte[]` data.
* Be sure to copy the incoming data and not store
* a slice.
*
@@ -3889,14 +3889,14 @@ struct Curl
* The event handler that gets called when data is needed for sending.
*
* Params:
- * callback = the callback that has a $(D void[]) buffer to be filled
+ * callback = the callback that has a `void[]` buffer to be filled
*
* Returns:
* The callback returns the number of elements in the buffer that have been
* filled and are ready to send.
- * The special value $(D Curl.abortRequest) can be returned in
+ * The special value `Curl.abortRequest` can be returned in
* order to abort the current request.
- * The special value $(D Curl.pauseRequest) can be returned in order to
+ * The special value `Curl.pauseRequest` can be returned in order to
* pause the current request.
*
* Example:
@@ -3968,7 +3968,7 @@ struct Curl
/**
* The event handler that gets called when the net socket has been created
- * but a $(D connect()) call has not yet been done. This makes it possible to set
+ * but a `connect()` call has not yet been done. This makes it possible to set
* misc. socket options.
*
* Params:
diff --git a/std/numeric.d b/std/numeric.d
index 4c059e1dc17..de38578543c 100644
--- a/std/numeric.d
+++ b/std/numeric.d
@@ -43,7 +43,7 @@ public enum CustomFloatFlags
/**
* Store values in normalized form by default. The actual precision of the
* significand is extended by 1 bit by assuming an implicit leading bit of 1
- * instead of 0. i.e. $(D 1.nnnn) instead of $(D 0.nnnn).
+ * instead of 0. i.e. `1.nnnn` instead of `0.nnnn`.
* True for all $(LUCKY IEE754) types
*/
storeNormalized = 2,
@@ -128,7 +128,7 @@ private template CustomFloatParams(uint precision, uint exponentWidth, CustomFlo
/**
* Allows user code to define custom floating-point formats. These formats are
* for storage only; all operations on them are performed by first implicitly
- * extracting them to $(D real) first. After the operation is completed the
+ * extracting them to `real` first. After the operation is completed the
* result can be stored in a custom floating-point value via assignment.
*/
template CustomFloat(uint bits)
@@ -496,7 +496,7 @@ public:
/// Returns: imaginary part
static @property CustomFloat im() { return CustomFloat(0.0f); }
- /// Initialize from any $(D real) compatible type.
+ /// Initialize from any `real` compatible type.
this(F)(F input) if (__traits(compiles, cast(real)input ))
{
this = input;
@@ -511,7 +511,7 @@ public:
significand = input.significand;
}
- /// Assigns from any $(D real) compatible type.
+ /// Assigns from any `real` compatible type.
void opAssign(F)(F input)
if (__traits(compiles, cast(real)input))
{
@@ -544,7 +544,7 @@ public:
significand = cast(T_sig) sig;
}
- /// Fetches the stored value either as a $(D float), $(D double) or $(D real).
+ /// Fetches the stored value either as a `float`, `double` or `real`.
@property F get(F)()
if (staticIndexOf!(Unqual!F, float, double, real) >= 0)
{
@@ -674,24 +674,24 @@ unittest
/**
Defines the fastest type to use when storing temporaries of a
-calculation intended to ultimately yield a result of type $(D F)
-(where $(D F) must be one of $(D float), $(D double), or $(D
+calculation intended to ultimately yield a result of type `F`
+(where `F` must be one of `float`, `double`, or $(D
real)). When doing a multi-step computation, you may want to store
-intermediate results as $(D FPTemporary!F).
+intermediate results as `FPTemporary!F`.
-The necessity of $(D FPTemporary) stems from the optimized
+The necessity of `FPTemporary` stems from the optimized
floating-point operations and registers present in virtually all
processors. When adding numbers in the example above, the addition may
-in fact be done in $(D real) precision internally. In that case,
-storing the intermediate $(D result) in $(D double format) is not only
+in fact be done in `real` precision internally. In that case,
+storing the intermediate `result` in $(D double format) is not only
less precise, it is also (surprisingly) slower, because a conversion
-from $(D real) to $(D double) is performed every pass through the
-loop. This being a lose-lose situation, $(D FPTemporary!F) has been
+from `real` to `double` is performed every pass through the
+loop. This being a lose-lose situation, `FPTemporary!F` has been
defined as the $(I fastest) type to use for calculations at precision
-$(D F). There is no need to define a type for the $(I most accurate)
-calculations, as that is always $(D real).
+`F`. There is no need to define a type for the $(I most accurate)
+calculations, as that is always `real`.
-Finally, there is no guarantee that using $(D FPTemporary!F) will
+Finally, there is no guarantee that using `FPTemporary!F` will
always be fastest, as the speed of floating-point calculations depends
on very many factors.
*/
@@ -719,9 +719,9 @@ unittest
/**
Implements the $(WEB tinyurl.com/2zb9yr, secant method) for finding a
-root of the function $(D fun) starting from points $(D [xn_1, x_n])
-(ideally close to the root). $(D Num) may be $(D float), $(D double),
-or $(D real).
+root of the function `fun` starting from points $(D [xn_1, x_n])
+(ideally close to the root). `Num` may be `float`, `double`,
+or `real`.
*/
template secantMethod(alias fun)
{
@@ -782,11 +782,11 @@ public:
/** Find a real root of a real function f(x) via bracketing.
*
- * Given a function $(D f) and a range $(D [a..b]) such that $(D f(a))
- * and $(D f(b)) have opposite signs, returns the value of $(D x) in
- * the range which is closest to a root of $(D f(x)). If $(D f(x))
+ * Given a function `f` and a range `[a..b]` such that `f(a)`
+ * and `f(b)` have opposite signs, returns the value of `x` in
+ * the range which is closest to a root of `f(x)`. If `f(x)`
* has more than one root in the range, one will be chosen
- * arbitrarily. If $(D f(x)) returns NaN, NaN will be returned;
+ * arbitrarily. If `f(x)` returns NaN, NaN will be returned;
* otherwise, this algorithm is guaranteed to succeed.
*
* Uses an algorithm based on TOMS748, which uses inverse cubic
@@ -794,7 +794,7 @@ public:
* or secant interpolation. Compared to TOMS748, this implementation
* improves worst-case performance by a factor of more than 100, and
* typical performance by a factor of 2. For 80-bit reals, most
- * problems require 8 to 15 calls to $(D f(x)) to achieve full machine
+ * problems require 8 to 15 calls to `f(x)` to achieve full machine
* precision. The worst-case performance (pathological cases) is
* approximately twice the number of bits.
*
@@ -830,28 +830,28 @@ T findRoot(T, DF)(scope DF f, in T a, in T b)
*
* f = Function to be analyzed
*
- * ax = Left bound of initial range of $(D f) known to contain the
+ * ax = Left bound of initial range of `f` known to contain the
* root.
*
- * bx = Right bound of initial range of $(D f) known to contain the
+ * bx = Right bound of initial range of `f` known to contain the
* root.
*
- * fax = Value of $(D f(ax)).
+ * fax = Value of `f(ax)`.
*
- * fbx = Value of $(D f(bx)). ($(D f(ax)) and $(D f(bx)) are commonly
+ * fbx = Value of `f(bx)`. (`f(ax)` and `f(bx)` are commonly
* known in advance.)
*
*
* tolerance = Defines an early termination condition. Receives the
* current upper and lower bounds on the root. The
- * delegate must return $(D true) when these bounds are
- * acceptable. If this function always returns $(D false),
+ * delegate must return `true` when these bounds are
+ * acceptable. If this function always returns `false`,
* full machine precision will be achieved.
*
* Returns:
*
* A tuple consisting of two ranges. The first two elements are the
- * range (in $(D x)) of the root, while the second pair of elements
+ * range (in `x`) of the root, while the second pair of elements
* are the corresponding function values at those points. If an exact
* root was found, both of the first two elements will contain the
* root, and the second pair of elements will be 0.
@@ -1391,10 +1391,10 @@ unittest
}
/**
-Computes $(LUCKY Euclidean distance) between input ranges $(D a) and
-$(D b). The two ranges must have the same length. The three-parameter
+Computes $(LUCKY Euclidean distance) between input ranges `a` and
+`b`. The two ranges must have the same length. The three-parameter
version stops computation as soon as the distance is greater than or
-equal to $(D limit) (this is useful to save computation if a small
+equal to `limit` (this is useful to save computation if a small
distance is sought).
*/
CommonType!(ElementType!(Range1), ElementType!(Range2))
@@ -1451,7 +1451,7 @@ unittest
}
/**
-Computes the $(LUCKY dot product) of input ranges $(D a) and $(D
+Computes the $(LUCKY dot product) of input ranges `a` and $(D
b). The two ranges must have the same length. If both ranges define
length, the check is done once; otherwise, it is done at each
iteration.
@@ -1546,7 +1546,7 @@ unittest
}
/**
-Computes the $(LUCKY cosine similarity) of input ranges $(D a) and $(D
+Computes the $(LUCKY cosine similarity) of input ranges `a` and $(D
b). The two ranges must have the same length. If both ranges define
length, the check is done once; otherwise, it is done at each
iteration. If either range has all-zero elements, return 0.
@@ -1584,14 +1584,14 @@ unittest
}
/**
-Normalizes values in $(D range) by multiplying each element with a
-number chosen such that values sum up to $(D sum). If elements in $(D
+Normalizes values in `range` by multiplying each element with a
+number chosen such that values sum up to `sum`. If elements in $(D
range) sum to zero, assigns $(D sum / range.length) to
-all. Normalization makes sense only if all elements in $(D range) are
-positive. $(D normalize) assumes that is the case without checking it.
+all. Normalization makes sense only if all elements in `range` are
+positive. `normalize` assumes that is the case without checking it.
-Returns: $(D true) if normalization completed normally, $(D false) if
-all elements in $(D range) were zero or if $(D range) is empty.
+Returns: `true` if normalization completed normally, `false` if
+all elements in `range` were zero or if `range` is empty.
*/
bool normalize(R)(R range, ElementType!(R) sum = 1)
if (isForwardRange!(R))
@@ -1647,7 +1647,7 @@ unittest
}
/**
-Computes accurate sum of binary logarithms of input range $(D r).
+Computes accurate sum of binary logarithms of input range `r`.
*/
ElementType!Range sumOfLog2s(Range)(Range r)
if (isInputRange!Range && isFloatingPoint!(ElementType!Range))
@@ -1686,12 +1686,12 @@ unittest
}
/**
-Computes $(LUCKY _entropy) of input range $(D r) in bits. This
-function assumes (without checking) that the values in $(D r) are all
-in $(D [0, 1]). For the entropy to be meaningful, often $(D r) should
+Computes $(LUCKY _entropy) of input range `r` in bits. This
+function assumes (without checking) that the values in `r` are all
+in $(D [0, 1]). For the entropy to be meaningful, often `r` should
be normalized too (i.e., its values should sum to 1). The
two-parameter version stops evaluating as soon as the intermediate
-result is greater than or equal to $(D max).
+result is greater than or equal to `max`.
*/
ElementType!Range entropy(Range)(Range r) if (isInputRange!Range)
{
@@ -1734,12 +1734,12 @@ unittest
/**
Computes the $(LUCKY Kullback-Leibler divergence) between input ranges
-$(D a) and $(D b), which is the sum $(D ai * log(ai / bi)). The base
+`a` and `b`, which is the sum $(D ai * log(ai / bi)). The base
of logarithm is 2. The ranges are assumed to contain elements in $(D
[0, 1]). Usually the ranges are normalized probability distributions,
but this is not required or checked by $(D
-kullbackLeiblerDivergence). If any element $(D bi) is zero and the
-corresponding element $(D ai) nonzero, returns infinity. (Otherwise,
+kullbackLeiblerDivergence). If any element `bi` is zero and the
+corresponding element `ai` nonzero, returns infinity. (Otherwise,
if $(D ai == 0 && bi == 0), the term $(D ai * log(ai / bi)) is
considered zero.) If the inputs are normalized, the result is
positive.
@@ -1779,15 +1779,15 @@ unittest
}
/**
-Computes the $(LUCKY Jensen-Shannon divergence) between $(D a) and $(D
+Computes the $(LUCKY Jensen-Shannon divergence) between `a` and $(D
b), which is the sum $(D (ai * log(2 * ai / (ai + bi)) + bi * log(2 *
bi / (ai + bi))) / 2). The base of logarithm is 2. The ranges are
assumed to contain elements in $(D [0, 1]). Usually the ranges are
normalized probability distributions, but this is not required or
-checked by $(D jensenShannonDivergence). If the inputs are normalized,
+checked by `jensenShannonDivergence`. If the inputs are normalized,
the result is bounded within $(D [0, 1]). The three-parameter version
stops evaluations as soon as the intermediate result is greater than
-or equal to $(D limit).
+or equal to `limit`.
*/
CommonType!(ElementType!Range1, ElementType!Range2)
jensenShannonDivergence(Range1, Range2)(Range1 a, Range2 b)
@@ -1861,18 +1861,18 @@ unittest
/**
The so-called "all-lengths gap-weighted string kernel" computes a
-similarity measure between $(D s) and $(D t) based on all of their
+similarity measure between `s` and `t` based on all of their
common subsequences of all lengths. Gapped subsequences are also
included.
To understand what $(D gapWeightedSimilarity(s, t, lambda)) computes,
consider first the case $(D lambda = 1) and the strings $(D s =
["Hello", "brave", "new", "world"]) and $(D t = ["Hello", "new",
-"world"]). In that case, $(D gapWeightedSimilarity) counts the
+"world"]). In that case, `gapWeightedSimilarity` counts the
following matches:
-$(OL $(LI three matches of length 1, namely $(D "Hello"), $(D "new"),
-and $(D "world");) $(LI three matches of length 2, namely ($(D
+$(OL $(LI three matches of length 1, namely `"Hello"`, `"new"`,
+and `"world"`;) $(LI three matches of length 2, namely ($(D
"Hello", "new")), ($(D "Hello", "world")), and ($(D "new", "world"));)
$(LI one match of length 3, namely ($(D "Hello", "new", "world")).))
@@ -1903,12 +1903,12 @@ tally. That leaves only 4 matches.
The most interesting case is when gapped matches still participate in
the result, but not as strongly as ungapped matches. The result will
be a smooth, fine-grained similarity measure between the input
-strings. This is where values of $(D lambda) between 0 and 1 enter
+strings. This is where values of `lambda` between 0 and 1 enter
into play: gapped matches are $(I exponentially penalized with the
-number of gaps) with base $(D lambda). This means that an ungapped
+number of gaps) with base `lambda`. This means that an ungapped
match adds 1 to the return value; a match with one gap in either
-string adds $(D lambda) to the return value; ...; a match with a total
-of $(D n) gaps in both strings adds $(D pow(lambda, n)) to the return
+string adds `lambda` to the return value; ...; a match with a total
+of `n` gaps in both strings adds $(D pow(lambda, n)) to the return
value. In the example above, we have 4 matches without gaps, 2 matches
with one gap, and 1 match with three gaps. The latter match is ($(D
"Hello", "world")), which has two gaps in the first string and one gap
@@ -1921,11 +1921,11 @@ string[] t = ["Hello", "new", "world"];
assert(gapWeightedSimilarity(s, t, 0.5) == 4 + 0.5 * 2 + 0.125);
----
-$(D gapWeightedSimilarity) is useful wherever a smooth similarity
+`gapWeightedSimilarity` is useful wherever a smooth similarity
measure between sequences allowing for approximate matches is
needed. The examples above are given with words, but any sequences
with elements comparable for equality are allowed, e.g. characters or
-numbers. $(D gapWeightedSimilarity) uses a highly optimized dynamic
+numbers. `gapWeightedSimilarity` uses a highly optimized dynamic
programming implementation that needs $(D 16 * min(s.length,
t.length)) extra bytes of memory and $(BIGOH s.length * t.length) time
to complete.
@@ -1986,25 +1986,25 @@ unittest
}
/**
-The similarity per $(D gapWeightedSimilarity) has an issue in that it
+The similarity per `gapWeightedSimilarity` has an issue in that it
grows with the lengths of the two strings, even though the strings are
not actually very similar. For example, the range $(D ["Hello",
"world"]) is increasingly similar with the range $(D ["Hello",
-"world", "world", "world",...]) as more instances of $(D "world") are
-appended. To prevent that, $(D gapWeightedSimilarityNormalized)
+"world", "world", "world",...]) as more instances of `"world"` are
+appended. To prevent that, `gapWeightedSimilarityNormalized`
computes a normalized version of the similarity that is computed as
$(D gapWeightedSimilarity(s, t, lambda) /
sqrt(gapWeightedSimilarity(s, t, lambda) * gapWeightedSimilarity(s, t,
-lambda))). The function $(D gapWeightedSimilarityNormalized) (a
-so-called normalized kernel) is bounded in $(D [0, 1]), reaches $(D 0)
-only for ranges that don't match in any position, and $(D 1) only for
+lambda))). The function `gapWeightedSimilarityNormalized` (a
+so-called normalized kernel) is bounded in $(D [0, 1]), reaches `0`
+only for ranges that don't match in any position, and `1` only for
identical ranges.
-The optional parameters $(D sSelfSim) and $(D tSelfSim) are meant for
+The optional parameters `sSelfSim` and `tSelfSim` are meant for
avoiding duplicate computation. Many applications may have already
computed $(D gapWeightedSimilarity(s, s, lambda)) and/or $(D
gapWeightedSimilarity(t, t, lambda)). In that case, they can be passed
-as $(D sSelfSim) and $(D tSelfSim), respectively.
+as `sSelfSim` and `tSelfSim`, respectively.
*/
Select!(isFloatingPoint!(F), F, double)
gapWeightedSimilarityNormalized(alias comp = "a == b", R1, R2, F)
@@ -2043,7 +2043,7 @@ unittest
}
/**
-Similar to $(D gapWeightedSimilarity), just works in an incremental
+Similar to `gapWeightedSimilarity`, just works in an incremental
manner by first revealing the matches of length 1, then gapped matches
of length 2, and so on. The memory requirement is $(BIGOH s.length *
t.length). The time complexity is $(BIGOH s.length * t.length) time
@@ -2069,8 +2069,8 @@ private:
public:
/**
-Constructs an object given two ranges $(D s) and $(D t) and a penalty
-$(D lambda). Constructor completes in $(BIGOH s.length * t.length)
+Constructs an object given two ranges `s` and `t` and a penalty
+`lambda`. Constructor completes in $(BIGOH s.length * t.length)
time and computes all matches of length 1.
*/
this(Range s, Range t, F lambda)
@@ -2130,7 +2130,7 @@ time and computes all matches of length 1.
}
/**
- Returns: $(D this).
+ Returns: `this`.
*/
ref GapWeightedSimilarityIncremental opSlice()
{
@@ -2223,7 +2223,7 @@ time and computes all matches of length 1.
/**
Returns: The gapped similarity at the current match length (initially
- 1, grows with each call to $(D popFront)).
+ 1, grows with each call to `popFront`).
*/
@property F front() { return currentValue; }
@@ -2337,7 +2337,7 @@ unittest
}
/**
-Computes the greatest common divisor of $(D a) and $(D b) by using
+Computes the greatest common divisor of `a` and `b` by using
Euclid's algorithm.
*/
T gcd(T)(T a, T b)
@@ -2679,8 +2679,8 @@ private:
}
public:
- /**Create an $(D Fft) object for computing fast Fourier transforms of
- * power of two sizes of $(D size) or smaller. $(D size) must be a
+ /**Create an `Fft` object for computing fast Fourier transforms of
+ * power of two sizes of `size` or smaller. `size` must be a
* power of two.
*/
this(size_t size)
@@ -2697,11 +2697,11 @@ public:
}
/**Compute the Fourier transform of range using the $(BIGOH N log N)
- * Cooley-Tukey Algorithm. $(D range) must be a random-access range with
- * slicing and a length equal to $(D size) as provided at the construction of
+ * Cooley-Tukey Algorithm. `range` must be a random-access range with
+ * slicing and a length equal to `size` as provided at the construction of
* this object. The contents of range can be either numeric types,
* which will be interpreted as pure real values, or complex types with
- * properties or members $(D .re) and $(D .im) that can be read.
+ * properties or members `.re` and `.im` that can be read.
*
* Note: Pure real FFTs are automatically detected and the relevant
* optimizations are performed.
@@ -2840,7 +2840,7 @@ private enum string MakeLocalFft = q{
auto fftObj = scoped!Fft(lookupBuf);
};
-/**Convenience functions that create an $(D Fft) object, run the FFT or inverse
+/**Convenience functions that create an `Fft` object, run the FFT or inverse
* FFT and return the result. Useful for one-off FFTs.
*
* Note: In addition to convenience, these functions are slightly more
diff --git a/std/outbuffer.d b/std/outbuffer.d
index e15229bca4e..cb27af78580 100644
--- a/std/outbuffer.d
+++ b/std/outbuffer.d
@@ -1,7 +1,7 @@
// Written in the D programming language.
/**
-Serialize data to $(D ubyte) arrays.
+Serialize data to `ubyte` arrays.
* Macros:
* WIKI = Phobos/StdOutbuffer
diff --git a/std/parallelism.d b/std/parallelism.d
index 1590c255818..e3a476e5e46 100644
--- a/std/parallelism.d
+++ b/std/parallelism.d
@@ -5,31 +5,31 @@ and future/promise _parallelism. $(D std._parallelism) is recommended when the
same operation is to be executed in parallel on different data, or when a
function is to be executed in a background thread and its result returned to a
well-defined main thread. For communication between arbitrary threads, see
-$(D std.concurrency).
+`std.concurrency`.
-$(D std._parallelism) is based on the concept of a $(D Task). A $(D Task) is an
+$(D std._parallelism) is based on the concept of a `Task`. A `Task` is an
object that represents the fundamental unit of work in this library and may be
-executed in parallel with any other $(D Task). Using $(D Task)
+executed in parallel with any other `Task`. Using `Task`
directly allows programming with a future/promise paradigm. All other
supported _parallelism paradigms (parallel foreach, map, reduce, pipelining)
-represent an additional level of abstraction over $(D Task). They
-automatically create one or more $(D Task) objects, or closely related types
+represent an additional level of abstraction over `Task`. They
+automatically create one or more `Task` objects, or closely related types
that are conceptually identical but not part of the public API.
-After creation, a $(D Task) may be executed in a new thread, or submitted
-to a $(D TaskPool) for execution. A $(D TaskPool) encapsulates a task queue
+After creation, a `Task` may be executed in a new thread, or submitted
+to a `TaskPool` for execution. A `TaskPool` encapsulates a task queue
and its worker threads. Its purpose is to efficiently map a large
-number of $(D Task)s onto a smaller number of threads. A task queue is a
-FIFO queue of $(D Task) objects that have been submitted to the
-$(D TaskPool) and are awaiting execution. A worker thread is a thread that
-is associated with exactly one task queue. It executes the $(D Task) at the
+number of `Task`s onto a smaller number of threads. A task queue is a
+FIFO queue of `Task` objects that have been submitted to the
+`TaskPool` and are awaiting execution. A worker thread is a thread that
+is associated with exactly one task queue. It executes the `Task` at the
front of its queue when the queue has work available, or sleeps when
no work is available. Each task queue is associated with zero or
-more worker threads. If the result of a $(D Task) is needed before execution
-by a worker thread has begun, the $(D Task) can be removed from the task queue
+more worker threads. If the result of a `Task` is needed before execution
+by a worker thread has begun, the `Task` can be removed from the task queue
and executed immediately in the thread where the result is needed.
-Warning: Unless marked as $(D @trusted) or $(D @safe), artifacts in
+Warning: Unless marked as `@trusted` or `@safe`, artifacts in
this module allow implicit data sharing between threads and cannot
guarantee that client code is free from low level data races.
@@ -417,32 +417,32 @@ private struct AbstractTask
}
/**
-$(D Task) represents the fundamental unit of work. A $(D Task) may be
-executed in parallel with any other $(D Task). Using this struct directly
+`Task` represents the fundamental unit of work. A `Task` may be
+executed in parallel with any other `Task`. Using this struct directly
allows future/promise _parallelism. In this paradigm, a function (or delegate
or other callable) is executed in a thread other than the one it was called
from. The calling thread does not block while the function is being executed.
-A call to $(D workForce), $(D yieldForce), or $(D spinForce) is used to
-ensure that the $(D Task) has finished executing and to obtain the return
-value, if any. These functions and $(D done) also act as full memory barriers,
-meaning that any memory writes made in the thread that executed the $(D Task)
+A call to `workForce`, `yieldForce`, or `spinForce` is used to
+ensure that the `Task` has finished executing and to obtain the return
+value, if any. These functions and `done` also act as full memory barriers,
+meaning that any memory writes made in the thread that executed the `Task`
are guaranteed to be visible in the calling thread after one of these functions
returns.
The $(XREF parallelism, task) and $(XREF parallelism, scopedTask) functions can
-be used to create an instance of this struct. See $(D task) for usage examples.
+be used to create an instance of this struct. See `task` for usage examples.
-Function results are returned from $(D yieldForce), $(D spinForce) and
-$(D workForce) by ref. If $(D fun) returns by ref, the reference will point
-to the returned reference of $(D fun). Otherwise it will point to a
+Function results are returned from `yieldForce`, `spinForce` and
+`workForce` by ref. If `fun` returns by ref, the reference will point
+to the returned reference of `fun`. Otherwise it will point to a
field in this struct.
Copying of this struct is disabled, since it would provide no useful semantics.
If you want to pass this struct around, you should do so by reference or
pointer.
-Bugs: Changes to $(D ref) and $(D out) arguments are not propagated to the
- call site, only to $(D args) in this struct.
+Bugs: Changes to `ref` and `out` arguments are not propagated to the
+ call site, only to `args` in this struct.
*/
struct Task(alias fun, Args...)
{
@@ -477,8 +477,8 @@ struct Task(alias fun, Args...)
Args _args;
/**
- The arguments the function was called with. Changes to $(D out) and
- $(D ref) arguments will be visible here.
+ The arguments the function was called with. Changes to `out` and
+ `ref` arguments will be visible here.
*/
static if(__traits(isSame, fun, run))
{
@@ -519,8 +519,8 @@ struct Task(alias fun, Args...)
/**
- The return type of the function called by this $(D Task). This can be
- $(D void).
+ The return type of the function called by this `Task`. This can be
+ `void`.
*/
alias ReturnType = typeof(fun(_args));
@@ -582,13 +582,13 @@ struct Task(alias fun, Args...)
}
/**
- If the $(D Task) isn't started yet, execute it in the current thread.
+ If the `Task` isn't started yet, execute it in the current thread.
If it's done, return its return value, if any. If it's in progress,
busy spin until it's done, then return the return value. If it threw
an exception, rethrow that exception.
This function should be used when you expect the result of the
- $(D Task) to be available on a timescale shorter than that of an OS
+ `Task` to be available on a timescale shorter than that of an OS
context switch.
*/
@property ref ReturnType spinForce() @trusted
@@ -611,7 +611,7 @@ struct Task(alias fun, Args...)
}
/**
- If the $(D Task) isn't started yet, execute it in the current thread.
+ If the `Task` isn't started yet, execute it in the current thread.
If it's done, return its return value, if any. If it's in progress,
wait on a condition variable. If it threw an exception, rethrow that
exception.
@@ -656,13 +656,13 @@ struct Task(alias fun, Args...)
}
/**
- If this $(D Task) was not started yet, execute it in the current
+ If this `Task` was not started yet, execute it in the current
thread. If it is finished, return its result. If it is in progress,
- execute any other $(D Task) from the $(D TaskPool) instance that
- this $(D Task) was submitted to until this one
+ execute any other `Task` from the `TaskPool` instance that
+ this `Task` was submitted to until this one
is finished. If it threw an exception, rethrow that exception.
- If no other tasks are available or this $(D Task) was executed using
- $(D executeInNewThread), wait on a condition variable.
+ If no other tasks are available or this `Task` was executed using
+ `executeInNewThread`, wait on a condition variable.
*/
@property ref ReturnType workForce() @trusted
{
@@ -730,10 +730,10 @@ struct Task(alias fun, Args...)
}
/**
- Returns $(D true) if the $(D Task) is finished executing.
+ Returns `true` if the `Task` is finished executing.
Throws: Rethrows any exception thrown during the execution of the
- $(D Task).
+ `Task`.
*/
@property bool done() @trusted
{
@@ -742,11 +742,11 @@ struct Task(alias fun, Args...)
}
/**
- Create a new thread for executing this $(D Task), execute it in the
+ Create a new thread for executing this `Task`, execute it in the
newly created thread, then terminate the thread. This can be used for
future/promise parallelism. An explicit priority may be given
- to the $(D Task). If one is provided, its value is forwarded to
- $(D core.thread.Thread.priority). See $(XREF parallelism, task) for
+ to the `Task`. If one is provided, its value is forwarded to
+ `core.thread.Thread.priority`. See $(XREF parallelism, task) for
usage example.
*/
void executeInNewThread() @trusted
@@ -773,8 +773,8 @@ struct Task(alias fun, Args...)
//@disable this(this) {}
}
-// Calls $(D fpOrDelegate) with $(D args). This is an
-// adapter that makes $(D Task) work with delegates, function pointers and
+// Calls `fpOrDelegate` with `args`. This is an
+// adapter that makes `Task` work with delegates, function pointers and
// functors instead of just aliases.
ReturnType!F run(F, Args...)(F fpOrDelegate, ref Args args)
{
@@ -782,12 +782,12 @@ ReturnType!F run(F, Args...)(F fpOrDelegate, ref Args args)
}
/**
-Creates a $(D Task) on the GC heap that calls an alias. This may be executed
-via $(D Task.executeInNewThread) or by submitting to a
+Creates a `Task` on the GC heap that calls an alias. This may be executed
+via `Task.executeInNewThread` or by submitting to a
$(XREF parallelism, TaskPool). A globally accessible instance of
-$(D TaskPool) is provided by $(XREF parallelism, taskPool).
+`TaskPool` is provided by $(XREF parallelism, taskPool).
-Returns: A pointer to the $(D Task).
+Returns: A pointer to the `Task`.
Examples:
---
@@ -853,7 +853,7 @@ auto task(alias fun, Args...)(Args args)
}
/**
-Creates a $(D Task) on the GC heap that calls a function pointer, delegate, or
+Creates a `Task` on the GC heap that calls a function pointer, delegate, or
class/struct with overloaded opCall.
Examples:
@@ -880,7 +880,7 @@ void main()
Notes: This function takes a non-scope delegate, meaning it can be
used with closures. If you can't allocate a closure due to objects
- on the stack that have scoped destruction, see $(D scopedTask), which
+ on the stack that have scoped destruction, see `scopedTask`, which
takes a scope delegate.
*/
auto task(F, Args...)(F delegateOrFp, Args args)
@@ -890,24 +890,24 @@ if(is(typeof(delegateOrFp(args))) && !isSafeTask!F)
}
/**
-Version of $(D task) usable from $(D @safe) code. Usage mechanics are
+Version of `task` usable from `@safe` code. Usage mechanics are
identical to the non-@safe case, but safety introduces some restrictions:
-1. $(D fun) must be @safe or @trusted.
+1. `fun` must be @safe or @trusted.
-2. $(D F) must not have any unshared aliasing as defined by
+2. `F` must not have any unshared aliasing as defined by
$(XREF traits, hasUnsharedAliasing). This means it
may not be an unshared delegate or a non-shared class or struct
- with overloaded $(D opCall). This also precludes accepting template
+ with overloaded `opCall`. This also precludes accepting template
alias parameters.
-3. $(D Args) must not have unshared aliasing.
+3. `Args` must not have unshared aliasing.
-4. $(D fun) must not return by reference.
+4. `fun` must not return by reference.
-5. The return type must not have unshared aliasing unless $(D fun) is
- $(D pure) or the $(D Task) is executed via $(D executeInNewThread) instead
- of using a $(D TaskPool).
+5. The return type must not have unshared aliasing unless `fun` is
+ `pure` or the `Task` is executed via `executeInNewThread` instead
+ of using a `TaskPool`.
*/
@trusted auto task(F, Args...)(F fun, Args args)
@@ -917,25 +917,25 @@ if(is(typeof(fun(args))) && isSafeTask!F)
}
/**
-These functions allow the creation of $(D Task) objects on the stack rather
-than the GC heap. The lifetime of a $(D Task) created by $(D scopedTask)
+These functions allow the creation of `Task` objects on the stack rather
+than the GC heap. The lifetime of a `Task` created by `scopedTask`
cannot exceed the lifetime of the scope it was created in.
-$(D scopedTask) might be preferred over $(D task):
+`scopedTask` might be preferred over `task`:
-1. When a $(D Task) that calls a delegate is being created and a closure
+1. When a `Task` that calls a delegate is being created and a closure
cannot be allocated due to objects on the stack that have scoped
- destruction. The delegate overload of $(D scopedTask) takes a $(D scope)
+ destruction. The delegate overload of `scopedTask` takes a `scope`
delegate.
2. As a micro-optimization, to avoid the heap allocation associated with
- $(D task) or with the creation of a closure.
+ `task` or with the creation of a closure.
-Usage is otherwise identical to $(D task).
+Usage is otherwise identical to `task`.
-Notes: $(D Task) objects created using $(D scopedTask) will automatically
-call $(D Task.yieldForce) in their destructor if necessary to ensure
-the $(D Task) is complete before the stack frame they reside on is destroyed.
+Notes: `Task` objects created using `scopedTask` will automatically
+call `Task.yieldForce` in their destructor if necessary to ensure
+the `Task` is complete before the stack frame they reside on is destroyed.
*/
auto scopedTask(alias fun, Args...)(Args args)
{
@@ -1006,17 +1006,17 @@ shared static ~this()
/**
This class encapsulates a task queue and a set of worker threads. Its purpose
-is to efficiently map a large number of $(D Task)s onto a smaller number of
-threads. A task queue is a FIFO queue of $(D Task) objects that have been
-submitted to the $(D TaskPool) and are awaiting execution. A worker thread is a
-thread that executes the $(D Task) at the front of the queue when one is
+is to efficiently map a large number of `Task`s onto a smaller number of
+threads. A task queue is a FIFO queue of `Task` objects that have been
+submitted to the `TaskPool` and are awaiting execution. A worker thread is a
+thread that executes the `Task` at the front of the queue when one is
available and sleeps when the queue is empty.
This class should usually be used via the global instantiation
available via the $(XREF parallelism, taskPool) property.
-Occasionally it is useful to explicitly instantiate a $(D TaskPool):
+Occasionally it is useful to explicitly instantiate a `TaskPool`:
-1. When you want $(D TaskPool) instances with multiple priorities, for example
+1. When you want `TaskPool` instances with multiple priorities, for example
a low priority pool and a high priority pool.
2. When the threads in the global task pool are waiting on a synchronization
@@ -1426,11 +1426,11 @@ public:
}
/**
- Default constructor that initializes a $(D TaskPool) with
- $(D totalCPUs) - 1 worker threads. The minus 1 is included because the
+ Default constructor that initializes a `TaskPool` with
+ `totalCPUs` - 1 worker threads. The minus 1 is included because the
main thread will also be available to do work.
- Note: On single-core machines, the primitives provided by $(D TaskPool)
+ Note: On single-core machines, the primitives provided by `TaskPool`
operate transparently in single-threaded mode.
*/
this() @trusted
@@ -1470,17 +1470,17 @@ public:
/**
Implements a parallel foreach loop over a range. This works by implicitly
- creating and submitting one $(D Task) to the $(D TaskPool) for each worker
- thread. A work unit is a set of consecutive elements of $(D range) to
+ creating and submitting one `Task` to the `TaskPool` for each worker
+ thread. A work unit is a set of consecutive elements of `range` to
be processed by a worker thread between communication with any other
thread. The number of elements processed per work unit is controlled by the
- $(D workUnitSize) parameter. Smaller work units provide better load
+ `workUnitSize` parameter. Smaller work units provide better load
balancing, but larger work units avoid the overhead of communicating
with other threads frequently to fetch the next work unit. Large work
units also avoid false sharing in cases where the range is being modified.
The less time a single iteration of the loop takes, the larger
- $(D workUnitSize) should be. For very expensive loop bodies,
- $(D workUnitSize) should be 1. An overload that chooses a default work
+ `workUnitSize` should be. For very expensive loop bodies,
+ `workUnitSize` should be 1. An overload that chooses a default work
unit size is also available.
Examples:
@@ -1514,18 +1514,18 @@ public:
Notes:
The memory usage of this implementation is guaranteed to be constant
- in $(D range.length).
+ in `range.length`.
Breaking from a parallel foreach loop via a break, labeled break,
labeled continue, return or goto statement throws a
- $(D ParallelForeachError).
+ `ParallelForeachError`.
In the case of non-random access ranges, parallel foreach buffers lazily
- to an array of size $(D workUnitSize) before executing the parallel portion
+ to an array of size `workUnitSize` before executing the parallel portion
of the loop. The exception is that, if a parallel foreach is executed
- over a range returned by $(D asyncBuf) or $(D map), the copying is elided
- and the buffers are simply swapped. In this case $(D workUnitSize) is
- ignored and the work unit size is set to the buffer size of $(D range).
+ over a range returned by `asyncBuf` or `map`, the copying is elided
+ and the buffers are simply swapped. In this case `workUnitSize` is
+ ignored and the work unit size is set to the buffer size of `range`.
A memory barrier is guaranteed to be executed on exit from the loop,
so that results produced by all threads are visible in the calling thread.
@@ -1533,10 +1533,10 @@ public:
$(B Exception Handling):
When at least one exception is thrown from inside a parallel foreach loop,
- the submission of additional $(D Task) objects is terminated as soon as
+ the submission of additional `Task` objects is terminated as soon as
possible, in a non-deterministic manner. All executing or
enqueued work units are allowed to complete. Then, all exceptions that
- were thrown by any work unit are chained using $(D Throwable.next) and
+ were thrown by any work unit are chained using `Throwable.next` and
rethrown. The order of the exception chaining is non-deterministic.
*/
ParallelForeach!R parallel(R)(R range, size_t workUnitSize)
@@ -1570,15 +1570,15 @@ public:
{
/**
Eager parallel map. The eagerness of this function means it has less
- overhead than the lazily evaluated $(D TaskPool.map) and should be
+ overhead than the lazily evaluated `TaskPool.map` and should be
preferred where the memory requirements of eagerness are acceptable.
- $(D functions) are the functions to be evaluated, passed as template alias
+ `functions` are the functions to be evaluated, passed as template alias
parameters in a style similar to $(XREF algorithm, map). The first
argument must be a random access range. For performance reasons, amap
will assume the range elements have not yet been initialized. Elements will
be overwritten without calling a destructor nor doing an assignment. As such,
the range must not contain meaningful data: either un-initialized objects, or
- objects in their $(D .init) state.
+ objects in their `.init` state.
---
auto numbers = iota(100_000_000.0);
@@ -1593,7 +1593,7 @@ public:
---
Immediately after the range argument, an optional work unit size argument
- may be provided. Work units as used by $(D amap) are identical to those
+ may be provided. Work units as used by `amap` are identical to those
defined for parallel foreach. If no work unit size is provided, the
default work unit size is used.
@@ -1638,15 +1638,15 @@ public:
To parallelize the copying of a range with expensive to evaluate elements
to an array, pass an identity function (a function that just returns
- whatever argument is provided to it) to $(D amap).
+ whatever argument is provided to it) to `amap`.
$(B Exception Handling):
When at least one exception is thrown from inside the map functions,
- the submission of additional $(D Task) objects is terminated as soon as
+ the submission of additional `Task` objects is terminated as soon as
possible, in a non-deterministic manner. All currently executing or
enqueued work units are allowed to complete. Then, all exceptions that
- were thrown from any work unit are chained using $(D Throwable.next) and
+ were thrown from any work unit are chained using `Throwable.next` and
rethrown. The order of the exception chaining is non-deterministic.
*/
auto amap(Args...)(Args args)
@@ -1765,8 +1765,8 @@ public:
{
/**
A semi-lazy parallel map that can be used for pipelining. The map
- functions are evaluated for the first $(D bufSize) elements and stored in a
- buffer and made available to $(D popFront). Meanwhile, in the
+ functions are evaluated for the first `bufSize` elements and stored in a
+ buffer and made available to `popFront`. Meanwhile, in the
background a second buffer of the same size is filled. When the first
buffer is exhausted, it is swapped with the second buffer and filled while
the values from what was originally the second buffer are read. This
@@ -1774,36 +1774,36 @@ public:
the need for atomic operations or synchronization for each write, and
enables the mapping function to be evaluated efficiently in parallel.
- $(D map) has more overhead than the simpler procedure used by $(D amap)
+ `map` has more overhead than the simpler procedure used by `amap`
but avoids the need to keep all results in memory simultaneously and works
with non-random access ranges.
Params:
- source = The input range to be mapped. If $(D source) is not random
- access it will be lazily buffered to an array of size $(D bufSize) before
+ source = The input range to be mapped. If `source` is not random
+ access it will be lazily buffered to an array of size `bufSize` before
the map function is evaluated. (For an exception to this rule, see Notes.)
bufSize = The size of the buffer to store the evaluated elements.
workUnitSize = The number of elements to evaluate in a single
- $(D Task). Must be less than or equal to $(D bufSize), and
- should be a fraction of $(D bufSize) such that all worker threads can be
+ `Task`. Must be less than or equal to `bufSize`, and
+ should be a fraction of `bufSize` such that all worker threads can be
used. If the default of size_t.max is used, workUnitSize will be set to
the pool-wide default.
Returns: An input range representing the results of the map. This range
- has a length iff $(D source) has a length.
+ has a length iff `source` has a length.
Notes:
- If a range returned by $(D map) or $(D asyncBuf) is used as an input to
- $(D map), then as an optimization the copying from the output buffer
+ If a range returned by `map` or `asyncBuf` is used as an input to
+ `map`, then as an optimization the copying from the output buffer
of the first range to the input buffer of the second range is elided, even
- though the ranges returned by $(D map) and $(D asyncBuf) are non-random
- access ranges. This means that the $(D bufSize) parameter passed to the
- current call to $(D map) will be ignored and the size of the buffer
- will be the buffer size of $(D source).
+ though the ranges returned by `map` and `asyncBuf` are non-random
+ access ranges. This means that the `bufSize` parameter passed to the
+ current call to `map` will be ignored and the size of the buffer
+ will be the buffer size of `source`.
Examples:
---
@@ -1826,11 +1826,11 @@ public:
$(B Exception Handling):
- Any exceptions thrown while iterating over $(D source)
- or computing the map function are re-thrown on a call to $(D popFront) or,
+ Any exceptions thrown while iterating over `source`
+ or computing the map function are re-thrown on a call to `popFront` or,
if thrown during construction, are simply allowed to propagate to the
caller. In the case of exceptions thrown while computing the map function,
- the exceptions are chained as in $(D TaskPool.amap).
+ the exceptions are chained as in `TaskPool.amap`.
*/
auto
map(S)(S source, size_t bufSize = 100, size_t workUnitSize = size_t.max)
@@ -2098,13 +2098,13 @@ public:
}
/**
- Given a $(D source) range that is expensive to iterate over, returns an
+ Given a `source` range that is expensive to iterate over, returns an
input range that asynchronously buffers the contents of
- $(D source) into a buffer of $(D bufSize) elements in a worker thread,
+ `source` into a buffer of `bufSize` elements in a worker thread,
while making previously buffered elements from a second buffer, also of size
- $(D bufSize), available via the range interface of the returned
- object. The returned range has a length iff $(D hasLength!S).
- $(D asyncBuf) is useful, for example, when performing expensive operations
+ `bufSize`, available via the range interface of the returned
+ object. The returned range has a length iff `hasLength!S`.
+ `asyncBuf` is useful, for example, when performing expensive operations
on the elements of ranges that represent data on a disk or network.
Examples:
@@ -2136,8 +2136,8 @@ public:
$(B Exception Handling):
- Any exceptions thrown while iterating over $(D source) are re-thrown on a
- call to $(D popFront) or, if thrown during construction, simply
+ Any exceptions thrown while iterating over `source` are re-thrown on a
+ call to `popFront` or, if thrown during construction, simply
allowed to propagate to the caller.
*/
auto asyncBuf(S)(S source, size_t bufSize = 100) if(isInputRange!S)
@@ -2278,30 +2278,30 @@ public:
}
/**
- Given a callable object $(D next) that writes to a user-provided buffer and
- a second callable object $(D empty) that determines whether more data is
- available to write via $(D next), returns an input range that
- asynchronously calls $(D next) with a set of size $(D nBuffers) of buffers
+ Given a callable object `next` that writes to a user-provided buffer and
+ a second callable object `empty` that determines whether more data is
+ available to write via `next`, returns an input range that
+ asynchronously calls `next` with a set of size `nBuffers` of buffers
and makes the results available in the order they were obtained via the
input range interface of the returned object. Similarly to the
- input range overload of $(D asyncBuf), the first half of the buffers
+ input range overload of `asyncBuf`, the first half of the buffers
are made available via the range interface while the second half are
filled and vice-versa.
Params:
next = A callable object that takes a single argument that must be an array
- with mutable elements. When called, $(D next) writes data to
+ with mutable elements. When called, `next` writes data to
the array provided by the caller.
empty = A callable object that takes no arguments and returns a type
- implicitly convertible to $(D bool). This is used to signify
- that no more data is available to be obtained by calling $(D next).
+ implicitly convertible to `bool`. This is used to signify
+ that no more data is available to be obtained by calling `next`.
- initialBufSize = The initial size of each buffer. If $(D next) takes its
+ initialBufSize = The initial size of each buffer. If `next` takes its
array by reference, it may resize the buffers.
- nBuffers = The number of buffers to cycle through when calling $(D next).
+ nBuffers = The number of buffers to cycle through when calling `next`.
Examples:
---
@@ -2330,8 +2330,8 @@ public:
$(B Exception Handling):
- Any exceptions thrown while iterating over $(D range) are re-thrown on a
- call to $(D popFront).
+ Any exceptions thrown while iterating over `range` are re-thrown on a
+ call to `popFront`.
Warning:
@@ -2362,15 +2362,15 @@ public:
Therefore, care must be taken to choose the seed value appropriately.
Because the reduction is being performed in parallel,
- $(D functions) must be associative. For notational simplicity, let # be an
- infix operator representing $(D functions). Then, (a # b) # c must equal
+ `functions` must be associative. For notational simplicity, let # be an
+ infix operator representing `functions`. Then, (a # b) # c must equal
a # (b # c). Floating point addition is not associative
even though addition in exact arithmetic is. Summing floating
point numbers using this function may give different results than summing
serially. However, for many practical purposes floating point addition
can be treated as associative.
- Note that, since $(D functions) are assumed to be associative, additional
+ Note that, since `functions` are assumed to be associative, additional
optimizations are made to the serial portion of the reduction algorithm.
These take advantage of the instruction level parallelism of modern CPUs,
in addition to the thread-level parallelism that the rest of this
@@ -2410,7 +2410,7 @@ public:
An explicit work unit size may be specified as the last argument.
Specifying too small a work unit size will effectively serialize the
reduction, as the final reduction of the result of each work unit will
- dominate computation time. If $(D TaskPool.size) for this instance
+ dominate computation time. If `TaskPool.size` for this instance
is zero, this parameter is ignored and one work unit is used.
---
// Use a work unit size of 100.
@@ -2421,7 +2421,7 @@ public:
---
Parallel reduce supports multiple functions, like
- $(D std.algorithm.reduce).
+ `std.algorithm.reduce`.
---
// Find both the min and max of nums.
auto minMax = taskPool.reduce!(min, max)(nums);
@@ -2432,7 +2432,7 @@ public:
$(B Exception Handling):
After this function is finished executing, any exceptions thrown
- are chained together via $(D Throwable.next) and rethrown. The chaining
+ are chained together via `Throwable.next` and rethrown. The chaining
order is non-deterministic.
*/
auto reduce(Args...)(Args args)
@@ -2728,9 +2728,9 @@ public:
}
/**
- Gets the index of the current thread relative to this $(D TaskPool). Any
+ Gets the index of the current thread relative to this `TaskPool`. Any
thread not in this pool will receive an index of 0. The worker threads in
- this pool receive unique indices of 1 through $(D this.size).
+ this pool receive unique indices of 1 through `this.size`.
This function is useful for maintaining worker-local resources.
@@ -2776,21 +2776,21 @@ public:
/**
Struct for creating worker-local storage. Worker-local storage is
thread-local storage that exists only for worker threads in a given
- $(D TaskPool) plus a single thread outside the pool. It is allocated on the
+ `TaskPool` plus a single thread outside the pool. It is allocated on the
garbage collected heap in a way that avoids _false sharing, and doesn't
necessarily have global scope within any thread. It can be accessed from
- any worker thread in the $(D TaskPool) that created it, and one thread
- outside this $(D TaskPool). All threads outside the pool that created a
+ any worker thread in the `TaskPool` that created it, and one thread
+ outside this `TaskPool`. All threads outside the pool that created a
given instance of worker-local storage share a single slot.
Since the underlying data for this struct is heap-allocated, this struct
has reference semantics when passed between functions.
- The main uses cases for $(D WorkerLocalStorageStorage) are:
+ The main uses cases for `WorkerLocalStorageStorage` are:
1. Performing parallel reductions with an imperative, as opposed to
functional, programming style. In this case, it's useful to treat
- $(D WorkerLocalStorageStorage) as local to each thread for only the parallel
+ `WorkerLocalStorageStorage` as local to each thread for only the parallel
portion of an algorithm.
2. Recycling temporary buffers across iterations of a parallel foreach loop.
@@ -2900,13 +2900,13 @@ public:
public:
/**
Get the current thread's instance. Returns by ref.
- Note that calling $(D get) from any thread
- outside the $(D TaskPool) that created this instance will return the
+ Note that calling `get` from any thread
+ outside the `TaskPool` that created this instance will return the
same reference, so an instance of worker-local storage should only be
accessed from one thread outside the pool that created it. If this
rule is violated, undefined behavior will result.
- If assertions are enabled and $(D toRange) has been called, then this
+ If assertions are enabled and `toRange` has been called, then this
WorkerLocalStorage instance is no longer worker-local and an assertion
failure will result when calling this method. This is not checked
when assertions are disabled for performance reasons.
@@ -2941,7 +2941,7 @@ public:
of your algorithm.
Calling this function sets a flag indicating that this struct is no
- longer worker-local, and attempting to use the $(D get) method again
+ longer worker-local, and attempting to use the `get` method again
will result in an assertion failure if assertions are enabled.
*/
WorkerLocalStorageRange!T toRange() @property
@@ -2971,9 +2971,9 @@ public:
Do not use this struct in the parallel portion of your algorithm.
The proper way to instantiate this object is to call
- $(D WorkerLocalStorage.toRange). Once instantiated, this object behaves
+ `WorkerLocalStorage.toRange`. Once instantiated, this object behaves
as a finite random-access range with assignable, lvalue elements and
- a length equal to the number of worker threads in the $(D TaskPool) that
+ a length equal to the number of worker threads in the `TaskPool` that
created it plus 1.
*/
static struct WorkerLocalStorageRange(T)
@@ -3057,9 +3057,9 @@ public:
/**
Creates an instance of worker-local storage, initialized with a given
- value. The value is $(D lazy) so that you can, for example, easily
+ value. The value is `lazy` so that you can, for example, easily
create one instance of a class for each worker. For usage example,
- see the $(D WorkerLocalStorage) struct.
+ see the `WorkerLocalStorage` struct.
*/
WorkerLocalStorage!T workerLocalStorage(T)(lazy T initialVal = T.init)
{
@@ -3080,12 +3080,12 @@ public:
/**
Signals to all worker threads to terminate as soon as they are finished
- with their current $(D Task), or immediately if they are not executing a
- $(D Task). $(D Task)s that were in queue will not be executed unless
- a call to $(D Task.workForce), $(D Task.yieldForce) or $(D Task.spinForce)
+ with their current `Task`, or immediately if they are not executing a
+ `Task`. `Task`s that were in queue will not be executed unless
+ a call to `Task.workForce`, `Task.yieldForce` or `Task.spinForce`
causes them to be executed.
- Use only if you have waited on every $(D Task) and therefore know the
+ Use only if you have waited on every `Task` and therefore know the
queue is empty, or if you speculatively executed some tasks and no longer
need the results.
*/
@@ -3102,13 +3102,13 @@ public:
If blocking argument is true, wait for all worker threads to terminate
before returning. This option might be used in applications where
- task results are never consumed-- e.g. when $(D TaskPool) is employed as a
+ task results are never consumed-- e.g. when `TaskPool` is employed as a
rudimentary scheduler for tasks which communicate by means other than
return values.
Warning: Calling this function with $(D blocking = true) from a worker
- thread that is a member of the same $(D TaskPool) that
- $(D finish) is being called on will result in a deadlock.
+ thread that is a member of the same `TaskPool` that
+ `finish` is being called on will result in a deadlock.
*/
void finish(bool blocking = false) @trusted
{
@@ -3147,7 +3147,7 @@ public:
}
/**
- Put a $(D Task) object on the back of the task queue. The $(D Task)
+ Put a `Task` object on the back of the task queue. The `Task`
object may be passed by pointer or reference.
Example:
@@ -3163,20 +3163,20 @@ public:
Notes:
- @trusted overloads of this function are called for $(D Task)s if
- $(XREF traits, hasUnsharedAliasing) is false for the $(D Task)'s
- return type or the function the $(D Task) executes is $(D pure).
- $(D Task) objects that meet all other requirements specified in the
- $(D @trusted) overloads of $(D task) and $(D scopedTask) may be created
- and executed from $(D @safe) code via $(D Task.executeInNewThread) but
- not via $(D TaskPool).
+ @trusted overloads of this function are called for `Task`s if
+ $(XREF traits, hasUnsharedAliasing) is false for the `Task`'s
+ return type or the function the `Task` executes is `pure`.
+ `Task` objects that meet all other requirements specified in the
+ `@trusted` overloads of `task` and `scopedTask` may be created
+ and executed from `@safe` code via `Task.executeInNewThread` but
+ not via `TaskPool`.
While this function takes the address of variables that may
be on the stack, some overloads are marked as @trusted.
- $(D Task) includes a destructor that waits for the task to complete
+ `Task` includes a destructor that waits for the task to complete
before destroying the stack frame it is allocated on. Therefore,
it is impossible for the stack frame to be destroyed before the task is
- complete and no longer referenced by a $(D TaskPool).
+ complete and no longer referenced by a `TaskPool`.
*/
void put(alias fun, Args...)(ref Task!(fun, Args) task)
if(!isSafeReturn!(typeof(task)))
@@ -3213,11 +3213,11 @@ public:
have terminated. A non-daemon thread will prevent a program from
terminating as long as it has not terminated.
- If any $(D TaskPool) with non-daemon threads is active, either $(D stop)
- or $(D finish) must be called on it before the program can terminate.
+ If any `TaskPool` with non-daemon threads is active, either `stop`
+ or `finish` must be called on it before the program can terminate.
- The worker treads in the $(D TaskPool) instance returned by the
- $(D taskPool) property are daemon by default. The worker threads of
+ The worker treads in the `TaskPool` instance returned by the
+ `taskPool` property are daemon by default. The worker threads of
manually instantiated task pools are non-daemon by default.
Note: For a size zero pool, the getter arbitrarily returns true and the
@@ -3243,9 +3243,9 @@ public:
/**
These functions allow getting and setting the OS scheduling priority of
- the worker threads in this $(D TaskPool). They forward to
- $(D core.thread.Thread.priority), so a given priority value here means the
- same thing as an identical priority value in $(D core.thread).
+ the worker threads in this `TaskPool`. They forward to
+ `core.thread.Thread.priority`, so a given priority value here means the
+ same thing as an identical priority value in `core.thread`.
Note: For a size zero pool, the getter arbitrarily returns
$(D core.thread.Thread.PRIORITY_MIN) and the setter has no effect.
@@ -3270,10 +3270,10 @@ public:
}
/**
-Returns a lazily initialized global instantiation of $(D TaskPool).
+Returns a lazily initialized global instantiation of `TaskPool`.
This function can safely be called concurrently from multiple non-worker
threads. The worker threads in this pool are daemon threads, meaning that it
-is not necessary to call $(D TaskPool.stop) or $(D TaskPool.finish) before
+is not necessary to call `TaskPool.stop` or `TaskPool.finish` before
terminating the main thread.
*/
@property TaskPool taskPool() @trusted
@@ -3305,10 +3305,10 @@ shared static this()
}
/**
-These properties get and set the number of worker threads in the $(D TaskPool)
-instance returned by $(D taskPool). The default value is $(D totalCPUs) - 1.
-Calling the setter after the first call to $(D taskPool) does not changes
-number of worker threads in the instance returned by $(D taskPool).
+These properties get and set the number of worker threads in the `TaskPool`
+instance returned by `taskPool`. The default value is `totalCPUs` - 1.
+Calling the setter after the first call to `taskPool` does not changes
+number of worker threads in the instance returned by `taskPool`.
*/
@property uint defaultPoolThreads() @trusted
{
@@ -3322,7 +3322,7 @@ number of worker threads in the instance returned by $(D taskPool).
}
/**
-Convenience functions that forwards to $(D taskPool.parallel). The
+Convenience functions that forwards to `taskPool.parallel`. The
purpose of these is to make parallel foreach less verbose and more
readable.
diff --git a/std/path.d b/std/path.d
index 254d8f0001c..ec55e8d0262 100644
--- a/std/path.d
+++ b/std/path.d
@@ -34,7 +34,7 @@
Upgrading:
$(WEB digitalmars.com/d/1.0/phobos/std_path.html#fnmatch) can
- be replaced with $(D globMatch).
+ be replaced with `globMatch`.
Authors:
Lars Tandle Kyllingstad,
@@ -206,7 +206,7 @@ private auto trimDirSeparators(R)(inout R path)
-/** This $(D enum) is used as a template argument to functions which
+/** This `enum` is used as a template argument to functions which
compare file names, and determines whether the comparison is
case sensitive or not.
*/
@@ -219,7 +219,7 @@ enum CaseSensitive : bool
yes = true,
/** The default (or most common) setting for the current platform.
- That is, $(D no) on Windows and Mac OS X, and $(D yes) on all
+ That is, `no` on Windows and Mac OS X, and `yes` on all
POSIX systems except OS X (Linux, *BSD, etc.).
*/
osDefault = osDefaultCaseSensitivity
@@ -235,9 +235,9 @@ else static assert (0);
/** Returns the name of a file, without any leading directory
and with an optional suffix chopped off.
- If $(D suffix) is specified, it will be compared to $(D path)
- using $(D filenameCmp!cs),
- where $(D cs) is an optional template parameter determining whether
+ If `suffix` is specified, it will be compared to `path`
+ using `filenameCmp!cs`,
+ where `cs` is an optional template parameter determining whether
the comparison is case sensitive or not. See the
$(LREF filenameCmp) documentation for details.
@@ -379,9 +379,9 @@ unittest
/** Returns the directory part of a path. On Windows, this
includes the drive letter if present.
- This function performs a memory allocation if and only if $(D path)
+ This function performs a memory allocation if and only if `path`
does not have a directory (in which case a new string is needed to
- hold the returned current-directory symbol, $(D ".")).
+ hold the returned current-directory symbol, `"."`).
Examples:
---
@@ -482,7 +482,7 @@ unittest
-/** Returns the root directory of the specified path, or $(D null) if the
+/** Returns the root directory of the specified path, or `null` if the
path is not rooted.
Examples:
@@ -545,11 +545,11 @@ unittest
-/** Returns the drive of a path, or $(D null) if the drive
+/** Returns the drive of a path, or `null` if the drive
is not specified. In the case of UNC paths, the network share
is returned.
- Always returns $(D null) on POSIX.
+ Always returns `null` on POSIX.
Examples:
---
@@ -666,7 +666,7 @@ private ptrdiff_t extSeparatorPos(R)(const R path)
/** Returns the _extension part of a file name, including the dot.
- If there is no _extension, $(D null) is returned.
+ If there is no _extension, `null` is returned.
Examples:
---
@@ -802,12 +802,12 @@ unittest
-/** Returns a string containing the _path given by $(D path), but where
- the extension has been set to $(D ext).
+/** Returns a string containing the _path given by `path`, but where
+ the extension has been set to `ext`.
If the filename already has an extension, it is replaced. If not, the
extension is simply appended to the filename. Including a leading dot
- in $(D ext) is optional.
+ in `ext` is optional.
If the extension is empty, this function is equivalent to
$(LREF stripExtension).
@@ -893,8 +893,8 @@ unittest
-/** Returns the _path given by $(D path), with the extension given by
- $(D ext) appended if the path doesn't already have one.
+/** Returns the _path given by `path`, with the extension given by
+ `ext` appended if the path doesn't already have one.
Including the dot in the extension is optional.
@@ -961,7 +961,7 @@ unittest
This function always allocates memory to hold the resulting path.
The variadic overload is guaranteed to only perform a single
- allocation, as is the range version if $(D paths) is a forward
+ allocation, as is the range version if `paths` is a forward
range.
*/
immutable(ElementEncodingType!(ElementType!Range))[]
@@ -1144,7 +1144,7 @@ unittest
/** Performs the same task as $(LREF buildPath),
while at the same time resolving current/parent directory
- symbols ($(D ".") and $(D "..")) and removing superfluous
+ symbols (`"."` and `".."`) and removing superfluous
directory separators.
It will return "." if the path leads to the starting directory.
On Windows, slashes are replaced with backslashes.
@@ -1928,7 +1928,7 @@ unittest
On Windows, an absolute path starts at the root directory of
a specific drive. Hence, it must start with $(D `d:\`) or $(D `d:/`),
- where $(D d) is the drive letter. Alternatively, it may be a
+ where `d` is the drive letter. Alternatively, it may be a
network path, i.e. a path starting with a double (back)slash.
---
version (Windows)
@@ -2000,14 +2000,14 @@ unittest
-/** Translates $(D path) into an absolute _path.
+/** Translates `path` into an absolute _path.
The following algorithm is used:
$(OL
- $(LI If $(D path) is empty, return $(D null).)
- $(LI If $(D path) is already absolute, return it.)
- $(LI Otherwise, append $(D path) to $(D base) and return
- the result. If $(D base) is not specified, the current
+ $(LI If `path` is empty, return `null`.)
+ $(LI If `path` is already absolute, return it.)
+ $(LI Otherwise, append `path` to `base` and return
+ the result. If `base` is not specified, the current
working directory is used.)
)
The function allocates memory if and only if it gets to the third stage
@@ -2032,7 +2032,7 @@ unittest
---
Throws:
- $(D Exception) if the specified _base directory is not absolute.
+ `Exception` if the specified _base directory is not absolute.
*/
string absolutePath(string path, lazy string base = getcwd())
@safe pure
@@ -2072,27 +2072,27 @@ unittest
-/** Translates $(D path) into a relative _path.
+/** Translates `path` into a relative _path.
- The returned _path is relative to $(D base), which is by default
+ The returned _path is relative to `base`, which is by default
taken to be the current working directory. If specified,
- $(D base) must be an absolute _path, and it is always assumed
- to refer to a directory. If $(D path) and $(D base) refer to
+ `base` must be an absolute _path, and it is always assumed
+ to refer to a directory. If `path` and `base` refer to
the same directory, the function returns $(D `.`).
The following algorithm is used:
$(OL
- $(LI If $(D path) is a relative directory, return it unaltered.)
- $(LI Find a common root between $(D path) and $(D base).
- If there is no common root, return $(D path) unaltered.)
+ $(LI If `path` is a relative directory, return it unaltered.)
+ $(LI Find a common root between `path` and `base`.
+ If there is no common root, return `path` unaltered.)
$(LI Prepare a string with as many $(D `../`) or $(D `..\`) as
necessary to reach the common root from base path.)
- $(LI Append the remaining segments of $(D path) to the string
+ $(LI Append the remaining segments of `path` to the string
and return.)
)
- In the second step, path components are compared using $(D filenameCmp!cs),
- where $(D cs) is an optional template parameter determining whether
+ In the second step, path components are compared using `filenameCmp!cs`,
+ where `cs` is an optional template parameter determining whether
the comparison is case sensitive or not. See the
$(LREF filenameCmp) documentation for details.
@@ -2123,7 +2123,7 @@ unittest
---
Throws:
- $(D Exception) if the specified _base directory is not absolute.
+ `Exception` if the specified _base directory is not absolute.
*/
string relativePath(CaseSensitive cs = CaseSensitive.osDefault)
(string path, lazy string base = getcwd())
@@ -2215,13 +2215,13 @@ unittest
-/** Compares filename characters and return $(D < 0) if $(D a < b), $(D 0) if
+/** Compares filename characters and return $(D < 0) if $(D a < b), `0` if
$(D a == b) and $(D > 0) if $(D a > b).
This function can perform a case-sensitive or a case-insensitive
- comparison. This is controlled through the $(D cs) template parameter
+ comparison. This is controlled through the `cs` template parameter
which, if not specified, is given by
- $(LREF CaseSensitive)$(D .osDefault).
+ $(LREF CaseSensitive)`.osDefault`.
On Windows, the backslash and slash characters ($(D `\`) and $(D `/`))
are considered equal.
@@ -2288,11 +2288,11 @@ unittest
/** Compares file names and returns
$(D < 0) if $(D filename1 < filename2),
- $(D 0) if $(D filename1 == filename2) and
+ `0` if $(D filename1 == filename2) and
$(D > 0) if $(D filename1 > filename2).
- Individual characters are compared using $(D filenameCharCmp!cs),
- where $(D cs) is an optional template parameter determining whether
+ Individual characters are compared using `filenameCharCmp!cs`,
+ where `cs` is an optional template parameter determining whether
the comparison is case sensitive or not. See the
$(LREF filenameCharCmp) documentation for details.
@@ -2371,22 +2371,22 @@ unittest
$(I meta-characters)) and can't be escaped. These are:
$(BOOKTABLE,
- $(TR $(TD $(D *))
+ $(TR $(TD `*`)
$(TD Matches 0 or more instances of any character.))
- $(TR $(TD $(D ?))
+ $(TR $(TD `?`)
$(TD Matches exactly one instance of any character.))
- $(TR $(TD $(D [)$(I chars)$(D ]))
+ $(TR $(TD `[`$(I chars)`]`)
$(TD Matches one instance of any character that appears
between the brackets.))
- $(TR $(TD $(D [!)$(I chars)$(D ]))
+ $(TR $(TD `[!`$(I chars)`]`)
$(TD Matches one instance of any character that does not
appear between the brackets after the exclamation mark.))
- $(TR $(TD $(D {)$(I string1)$(D ,)$(I string2)$(D ,)…$(D }))
+ $(TR $(TD `{`$(I string1)`,`$(I string2)`,`…`}`)
$(TD Matches either of the specified strings.))
)
- Individual characters are compared using $(D filenameCharCmp!cs),
- where $(D cs) is an optional template parameter determining whether
+ Individual characters are compared using `filenameCharCmp!cs`,
+ where `cs` is an optional template parameter determining whether
the comparison is case sensitive or not. See the
$(LREF filenameCharCmp) documentation for details.
@@ -2395,7 +2395,7 @@ unittest
further portions of the path.
Returns:
- $(D true) if pattern matches path, $(D false) otherwise.
+ `true` if pattern matches path, `false` otherwise.
See_also:
$(LINK2 http://en.wikipedia.org/wiki/Glob_%28programming%29,Wikipedia: _glob (programming))
@@ -2595,28 +2595,28 @@ unittest
/** Checks that the given file or directory name is valid.
- This function returns $(D true) if and only if $(D filename) is not
+ This function returns `true` if and only if `filename` is not
empty, not too long, and does not contain invalid characters.
- The maximum length of $(D filename) is given by the constant
+ The maximum length of `filename` is given by the constant
$(D core.stdc.stdio.FILENAME_MAX). (On Windows, this number is
defined as the maximum number of UTF-16 code points, and the
test will therefore only yield strictly correct results when
- $(D filename) is a string of $(D wchar)s.)
+ `filename` is a string of `wchar`s.)
On Windows, the following criteria must be satisfied
($(LINK2 http://msdn.microsoft.com/en-us/library/aa365247(v=vs.85).aspx,source)):
$(UL
- $(LI $(D filename) must not contain any characters whose integer
+ $(LI `filename` must not contain any characters whose integer
representation is in the range 0-31.)
- $(LI $(D filename) must not contain any of the following $(I reserved
+ $(LI `filename` must not contain any of the following $(I reserved
characters): <>:"/\|?*)
- $(LI $(D filename) may not end with a space ($(D ' ')) or a period
- ($(D '.')).)
+ $(LI `filename` may not end with a space ($(D ' ')) or a period
+ (`'.'`).)
)
- On POSIX, $(D filename) may not contain a forward slash ($(D '/')) or
- the null character ($(D '\0')).
+ On POSIX, `filename` may not contain a forward slash (`'/'`) or
+ the null character (`'\0'`).
*/
bool isValidFilename(R)(R filename)
if (isRandomAccessRange!R && isSomeChar!(ElementType!R) ||
@@ -2697,27 +2697,27 @@ unittest
-/** Checks whether $(D path) is a valid _path.
+/** Checks whether `path` is a valid _path.
- Generally, this function checks that $(D path) is not empty, and that
+ Generally, this function checks that `path` is not empty, and that
each component of the path either satisfies $(LREF isValidFilename)
- or is equal to $(D ".") or $(D "..").
+ or is equal to `"."` or `".."`.
It does $(I not) check whether the _path points to an existing file
or directory; use $(XREF file,exists) for this purpose.
On Windows, some special rules apply:
$(UL
- $(LI If the second character of $(D path) is a colon ($(D ':')),
+ $(LI If the second character of `path` is a colon (`':'`),
the first character is interpreted as a drive letter, and
must be in the range A-Z (case insensitive).)
- $(LI If $(D path) is on the form $(D `\\$(I server)\$(I share)\...`)
+ $(LI If `path` is on the form $(D `\\$(I server)\$(I share)\...`)
(UNC path), $(LREF isValidFilename) is applied to $(I server)
and $(I share) as well.)
- $(LI If $(D path) starts with $(D `\\?\`) (long UNC path), the
+ $(LI If `path` starts with $(D `\\?\`) (long UNC path), the
only requirement for the rest of the string is that it does
not contain the null character.)
- $(LI If $(D path) starts with $(D `\\.\`) (Win32 device namespace)
- this function returns $(D false); such paths are beyond the scope
+ $(LI If `path` starts with $(D `\\.\`) (Win32 device namespace)
+ this function returns `false`; such paths are beyond the scope
of this module.)
)
*/
@@ -2855,16 +2855,16 @@ unittest
There are two ways of using tilde expansion in a path. One
involves using the tilde alone or followed by a path separator. In
this case, the tilde will be expanded with the value of the
- environment variable $(D HOME). The second way is putting
- a username after the tilde (i.e. $(D ~john/Mail)). Here,
+ environment variable `HOME`. The second way is putting
+ a username after the tilde (i.e. `~john/Mail`). Here,
the username will be searched for in the user database
- (i.e. $(D /etc/passwd) on Unix systems) and will expand to
+ (i.e. `/etc/passwd` on Unix systems) and will expand to
whatever path is stored there. The username is considered the
string after the tilde ending at the first instance of a path
separator.
- Note that using the $(D ~user) syntax may give different
- values from just $(D ~) if the environment variable doesn't
+ Note that using the `~user` syntax may give different
+ values from just `~` if the environment variable doesn't
match the value stored in the user database.
When the environment variable version is used, the path won't
@@ -2876,9 +2876,9 @@ unittest
This function performs several memory allocations.
Returns:
- $(D inputPath) with the tilde expanded, or just $(D inputPath)
+ `inputPath` with the tilde expanded, or just `inputPath`
if it could not be expanded.
- For Windows, $(D expandTilde) merely returns its argument $(D inputPath).
+ For Windows, `expandTilde` merely returns its argument `inputPath`.
Examples:
-----
diff --git a/std/process.d b/std/process.d
index 93375b2bc31..d8fb9d7cfbd 100644
--- a/std/process.d
+++ b/std/process.d
@@ -10,13 +10,13 @@ $(UL $(LI
arbitrary set of standard input, output, and error streams.
The function returns immediately, leaving the child _process to execute
in parallel with its parent. All other functions in this module that
- spawn processes are built around $(D spawnProcess).)
+ spawn processes are built around `spawnProcess`.)
$(LI
$(LREF wait) makes the parent _process wait for a child _process to
terminate. In general one should always do this, to avoid
child processes becoming "zombies" when the parent _process exits.
Scope guards are perfect for this – see the $(LREF spawnProcess)
- documentation for examples. $(LREF tryWait) is similar to $(D wait),
+ documentation for examples. $(LREF tryWait) is similar to `wait`,
but does not block if the _process has not yet terminated.)
$(LI
$(LREF pipeProcess) also spawns a child _process which runs
@@ -24,7 +24,7 @@ $(LI
arbitrary streams, it automatically creates a set of
pipes that allow the parent to communicate with the child
through the child's standard input, output, and/or error streams.
- This function corresponds roughly to C's $(D popen) function.)
+ This function corresponds roughly to C's `popen` function.)
$(LI
$(LREF execute) starts a new _process and waits for it
to complete before returning. Additionally, it captures
@@ -32,10 +32,10 @@ $(LI
the output of these as a string.)
$(LI
$(LREF spawnShell), $(LREF pipeShell) and $(LREF executeShell) work like
- $(D spawnProcess), $(D pipeProcess) and $(D execute), respectively,
+ `spawnProcess`, `pipeProcess` and `execute`, respectively,
except that they take a single command string and run it through
the current user's default command interpreter.
- $(D executeShell) corresponds roughly to C's $(D system) function.)
+ `executeShell` corresponds roughly to C's `system` function.)
$(LI
$(LREF kill) attempts to terminate a running _process.)
)
@@ -172,18 +172,18 @@ input, output, and error streams.
The function returns immediately, leaving the child _process to execute
in parallel with its parent. It is recommended to always call $(LREF wait)
-on the returned $(LREF Pid), as detailed in the documentation for $(D wait).
+on the returned $(LREF Pid), as detailed in the documentation for `wait`.
Command_line:
There are four overloads of this function. The first two take an array
-of strings, $(D args), which should contain the program name as the
+of strings, `args`, which should contain the program name as the
zeroth element and any command-line arguments in subsequent elements.
The third and fourth versions are included for convenience, and may be
used when there are no command-line arguments. They take a single string,
-$(D program), which specifies the program name.
+`program`, which specifies the program name.
-Unless a directory is specified in $(D args[0]) or $(D program),
-$(D spawnProcess) will search for the program in a platform-dependent
+Unless a directory is specified in `args[0]` or `program`,
+`spawnProcess` will search for the program in a platform-dependent
manner. On POSIX systems, it will look for the executable in the
directories listed in the PATH environment variable, in the order
they are listed. On Windows, it will search for the executable in
@@ -213,19 +213,19 @@ if (wait(dmdPid) != 0)
Environment_variables:
By default, the child process inherits the environment of the parent
-process, along with any additional variables specified in the $(D env)
+process, along with any additional variables specified in the `env`
parameter. If the same variable exists in both the parent's environment
-and in $(D env), the latter takes precedence.
+and in `env`, the latter takes precedence.
-If the $(LREF Config.newEnv) flag is set in $(D config), the child
+If the $(LREF Config.newEnv) flag is set in `config`, the child
process will $(I not) inherit the parent's environment. Its entire
-environment will then be determined by $(D env).
+environment will then be determined by `env`.
---
wait(spawnProcess("myapp", ["foo" : "bar"], Config.newEnv));
---
Standard_streams:
-The optional arguments $(D stdin), $(D stdout) and $(D stderr) may
+The optional arguments `stdin`, `stdout` and `stderr` may
be used to assign arbitrary $(XREF stdio,File) objects as the standard
input, output and error streams, respectively, of the child process. The
former must be opened for reading, while the latter two must be opened for
@@ -243,14 +243,14 @@ if (wait(pid) != 0)
writeln("Compilation failed. See errors.log for details.");
---
-Note that if you pass a $(D File) object that is $(I not)
+Note that if you pass a `File` object that is $(I not)
one of the standard input/output/error streams of the parent process,
that stream will by default be $(I closed) in the parent process when
this function returns. See the $(LREF Config) documentation below for
information about how to disable this behaviour.
-Beware of buffering issues when passing $(D File) objects to
-$(D spawnProcess). The child process will inherit the low-level raw
+Beware of buffering issues when passing `File` objects to
+`spawnProcess`. The child process will inherit the low-level raw
read/write offset associated with the underlying file descriptor, but
it will not be aware of any buffered data. In cases where this matters
(e.g. when a file should be aligned before being passed on to the
@@ -284,7 +284,7 @@ Throws:
$(LREF ProcessException) on failure to start the process.$(BR)
$(XREF stdio,StdioException) on failure to pass one of the streams
to the child process (Windows only).$(BR)
-$(CXREF exception,RangeError) if $(D args) is empty.
+$(CXREF exception,RangeError) if `args` is empty.
*/
Pid spawnProcess(in char[][] args,
File stdin = std.stdio.stdin,
@@ -912,13 +912,13 @@ unittest // Reopening the standard streams (issue 13258)
A variation on $(LREF spawnProcess) that runs the given _command through
the current user's preferred _command interpreter (aka. shell).
-The string $(D command) is passed verbatim to the shell, and is therefore
+The string `command` is passed verbatim to the shell, and is therefore
subject to its rules about _command structure, argument/filename quoting
and escaping of special characters.
The path to the shell executable is determined by the $(LREF userShell)
function.
-In all other respects this function works just like $(D spawnProcess).
+In all other respects this function works just like `spawnProcess`.
Please refer to the $(LREF spawnProcess) documentation for descriptions
of the other function parameters, the return value and any exceptions
that may be thrown.
@@ -1064,7 +1064,7 @@ enum Config
/**
On Windows, if the child process is a console application, this
flag will prevent the creation of a console window. Otherwise,
- it will be ignored. On POSIX, $(D suppressConsole) has no effect.
+ it will be ignored. On POSIX, `suppressConsole` has no effect.
*/
suppressConsole = 16,
@@ -1074,7 +1074,7 @@ enum Config
to subtle bugs when pipes or multiple threads are involved,
$(LREF spawnProcess) ensures that all file descriptors except the
ones that correspond to standard input/output/error are closed
- in the child process when it starts. Use $(D inheritFDs) to prevent
+ in the child process when it starts. Use `inheritFDs` to prevent
this.
On Windows, this option has no effect, and any handles which have been
@@ -1107,7 +1107,7 @@ final class Pid
This handle is used to specify the process in OS-specific APIs.
On POSIX, this function returns a $(D core.sys.posix.sys.types.pid_t)
with the same value as $(LREF Pid.processID), while on Windows it returns
- a $(D core.sys.windows.windows.HANDLE).
+ a `core.sys.windows.windows.HANDLE`.
Once $(LREF wait) has been called on the $(LREF Pid), this method
will return an invalid handle.
@@ -1248,7 +1248,7 @@ private:
/**
-Waits for the process associated with $(D pid) to terminate, and returns
+Waits for the process associated with `pid` to terminate, and returns
its exit status.
In general one should always _wait for child processes to terminate
@@ -1265,8 +1265,8 @@ If the process is terminated by a signal, this function returns a
negative number whose absolute value is the signal number.
Since POSIX restricts normal exit codes to the range 0-255, a
negative return value will always indicate termination by signal.
-Signal codes are defined in the $(D core.sys.posix.signal) module
-(which corresponds to the $(D signal.h) POSIX header).
+Signal codes are defined in the `core.sys.posix.signal` module
+(which corresponds to the `signal.h` POSIX header).
Throws:
$(LREF ProcessException) on failure.
@@ -1305,18 +1305,18 @@ unittest // Pid and wait()
/**
A non-blocking version of $(LREF wait).
-If the process associated with $(D pid) has already terminated,
-$(D tryWait) has the exact same effect as $(D wait).
-In this case, it returns a tuple where the $(D terminated) field
-is set to $(D true) and the $(D status) field has the same
-interpretation as the return value of $(D wait).
+If the process associated with `pid` has already terminated,
+`tryWait` has the exact same effect as `wait`.
+In this case, it returns a tuple where the `terminated` field
+is set to `true` and the `status` field has the same
+interpretation as the return value of `wait`.
If the process has $(I not) yet terminated, this function differs
-from $(D wait) in that does not wait for this to happen, but instead
-returns immediately. The $(D terminated) field of the returned
-tuple will then be set to $(D false), while the $(D status) field
-will always be 0 (zero). $(D wait) or $(D tryWait) should then be
-called again on the same $(D Pid) at some later time; not only to
+from `wait` in that does not wait for this to happen, but instead
+returns immediately. The `terminated` field of the returned
+tuple will then be set to `false`, while the `status` field
+will always be 0 (zero). `wait` or `tryWait` should then be
+called again on the same `Pid` at some later time; not only to
get the exit code, but also to avoid the process becoming a "zombie"
when it finally terminates. (See $(LREF wait) for details).
@@ -1340,9 +1340,9 @@ if (dmd.terminated)
else writeln("Still compiling...");
...
---
-Note that in this example, the first $(D wait) call will have no
-effect if the process has already terminated by the time $(D tryWait)
-is called. In the opposite case, however, the $(D scope) statement
+Note that in this example, the first `wait` call will have no
+effect if the process has already terminated by the time `tryWait`
+is called. In the opposite case, however, the `scope` statement
ensures that we always wait for the process if it hasn't terminated
by the time we reach the end of the scope.
*/
@@ -1357,21 +1357,21 @@ auto tryWait(Pid pid) @safe
/**
-Attempts to terminate the process associated with $(D pid).
+Attempts to terminate the process associated with `pid`.
-The effect of this function, as well as the meaning of $(D codeOrSignal),
+The effect of this function, as well as the meaning of `codeOrSignal`,
is highly platform dependent. Details are given below. Common to all
platforms is that this function only $(I initiates) termination of the process,
and returns immediately. It does not wait for the process to end,
nor does it guarantee that the process does in fact get terminated.
-Always call $(LREF wait) to wait for a process to complete, even if $(D kill)
+Always call $(LREF wait) to wait for a process to complete, even if `kill`
has been called on it.
Windows_specific:
The process will be
$(LINK2 http://msdn.microsoft.com/en-us/library/windows/desktop/ms686714%28v=vs.100%29.aspx,
-forcefully and abruptly terminated). If $(D codeOrSignal) is specified, it
+forcefully and abruptly terminated). If `codeOrSignal` is specified, it
must be a nonnegative number which will be used as the exit code of the process.
If not, the process wil exit with code 1. Do not use $(D codeOrSignal = 259),
as this is a special value (aka. $(LINK2 http://msdn.microsoft.com/en-us/library/windows/desktop/ms683189.aspx,STILL_ACTIVE))
@@ -1384,13 +1384,13 @@ assert (wait(pid) == 10);
POSIX_specific:
A $(LINK2 http://en.wikipedia.org/wiki/Unix_signal,signal) will be sent to
-the process, whose value is given by $(D codeOrSignal). Depending on the
+the process, whose value is given by `codeOrSignal`. Depending on the
signal sent, this may or may not terminate the process. Symbolic constants
for various $(LINK2 http://en.wikipedia.org/wiki/Unix_signal#POSIX_signals,
-POSIX signals) are defined in $(D core.sys.posix.signal), which corresponds to the
+POSIX signals) are defined in `core.sys.posix.signal`, which corresponds to the
$(LINK2 http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html,
-$(D signal.h) POSIX header). If $(D codeOrSignal) is omitted, the
-$(D SIGTERM) signal will be sent. (This matches the behaviour of the
+`signal.h` POSIX header). If `codeOrSignal` is omitted, the
+`SIGTERM` signal will be sent. (This matches the behaviour of the
$(LINK2 http://pubs.opengroup.org/onlinepubs/9699919799/utilities/kill.html,
$(D _kill)) shell command.)
---
@@ -1607,16 +1607,16 @@ unittest
Starts a new process, creating pipes to redirect its standard
input, output and/or error streams.
-$(D pipeProcess) and $(D pipeShell) are convenient wrappers around
+`pipeProcess` and `pipeShell` are convenient wrappers around
$(LREF spawnProcess) and $(LREF spawnShell), respectively, and
automate the task of redirecting one or more of the child process'
standard streams through pipes. Like the functions they wrap,
these functions return immediately, leaving the child process to
execute in parallel with the invoking process. It is recommended
to always call $(LREF wait) on the returned $(LREF ProcessPipes.pid),
-as detailed in the documentation for $(D wait).
+as detailed in the documentation for `wait`.
-The $(D args)/$(D program)/$(D command), $(D env) and $(D config)
+The `args`/`program`/`command`, `env` and `config`
parameters are forwarded straight to the underlying spawn functions,
and we refer to their documentation for details.
@@ -1635,7 +1635,7 @@ env = Additional environment variables for the child process.
(See $(LREF spawnProcess) for details.)
config = Flags that control process creation. See $(LREF Config)
for an overview of available flags, and note that the
- $(D retainStd...) flags have no effect in this function.
+ `retainStd...` flags have no effect in this function.
workDir = The working directory for the new process.
By default the child process inherits the parent's working
directory.
@@ -1817,13 +1817,13 @@ enum Redirect
/**
Redirect the standard error stream into the standard output stream.
- This can not be combined with $(D Redirect.stderr).
+ This can not be combined with `Redirect.stderr`.
*/
stderrToStdout = 8,
/**
Redirect the standard output stream into the standard error stream.
- This can not be combined with $(D Redirect.stdout).
+ This can not be combined with `Redirect.stdout`.
*/
stdoutToStderr = 16,
}
@@ -1977,7 +1977,7 @@ private:
Executes the given program or shell command and returns its exit
code and output.
-$(D execute) and $(D executeShell) start a new process using
+`execute` and `executeShell` start a new process using
$(LREF spawnProcess) and $(LREF spawnShell), respectively, and wait
for the process to complete before returning. The functions capture
what the child process prints to both its standard output and
@@ -1991,7 +1991,7 @@ if (ls.status != 0) writeln("Failed to retrieve file listing");
else writeln(ls.output);
---
-The $(D args)/$(D program)/$(D command), $(D env) and $(D config)
+The `args`/`program`/`command`, `env` and `config`
parameters are forwarded straight to the underlying spawn functions,
and we refer to their documentation for details.
@@ -2007,7 +2007,7 @@ env = Additional environment variables for the child process.
(See $(LREF spawnProcess) for details.)
config = Flags that control process creation. See $(LREF Config)
for an overview of available flags, and note that the
- $(D retainStd...) flags have no effect in this function.
+ `retainStd...` flags have no effect in this function.
maxOutput = The maximum number of bytes of output that should be
captured.
workDir = The working directory for the new process.
@@ -2018,7 +2018,7 @@ Returns:
An $(D std.typecons.Tuple!(int, "status", string, "output")).
POSIX_specific:
-If the process is terminated by a signal, the $(D status) field of
+If the process is terminated by a signal, the `status` field of
the return value will contain a negative number whose absolute
value is the signal number. (See $(LREF wait) for details.)
@@ -2194,11 +2194,11 @@ class ProcessException : Exception
Determines the path to the current user's default command interpreter.
On Windows, this function returns the contents of the COMSPEC environment
-variable, if it exists. Otherwise, it returns the string $(D "cmd.exe").
+variable, if it exists. Otherwise, it returns the string `"cmd.exe"`.
-On POSIX, $(D userShell) returns the contents of the SHELL environment
+On POSIX, `userShell` returns the contents of the SHELL environment
variable, if it exists and is non-empty. Otherwise, it returns
-$(D "/bin/sh").
+`"/bin/sh"`.
*/
@property string userShell() @safe
{
@@ -2310,7 +2310,7 @@ string url = "http://dlang.org/";
executeShell(escapeShellCommand("wget", url, "-O", "dlang-index.html"));
---
-Concatenate multiple $(D escapeShellCommand) and
+Concatenate multiple `escapeShellCommand` and
$(LREF escapeShellFileName) results to use shell redirection or
piping operators.
---
@@ -2805,7 +2805,7 @@ abstract final class environment
{
static:
/**
- Retrieves the value of the environment variable with the given $(D name).
+ Retrieves the value of the environment variable with the given `name`.
---
auto path = environment["PATH"];
---
@@ -2826,7 +2826,7 @@ static:
}
/**
- Retrieves the value of the environment variable with the given $(D name),
+ Retrieves the value of the environment variable with the given `name`,
or a default value if the variable doesn't exist.
Unlike $(LREF environment.opIndex), this function never throws.
@@ -2858,8 +2858,8 @@ static:
}
/**
- Assigns the given $(D value) to the environment variable with the given
- $(D name).
+ Assigns the given `value` to the environment variable with the given
+ `name`.
If the variable does not exist, it will be created. If it already exists,
it will be overwritten.
@@ -2899,7 +2899,7 @@ static:
}
/**
- Removes the environment variable with the given $(D name).
+ Removes the environment variable with the given `name`.
If the variable isn't in the environment, this function returns
successfully without doing anything.
@@ -2917,7 +2917,7 @@ static:
Windows_specific:
While Windows environment variable names are case insensitive, D's
built-in associative arrays are not. This function will store all
- variable names in uppercase (e.g. $(D PATH)).
+ variable names in uppercase (e.g. `PATH`).
Throws:
$(OBJECTREF Exception) if the environment variables could not
@@ -3124,21 +3124,21 @@ version (unittest)
/**
- Execute $(D command) in a _command shell.
+ Execute `command` in a _command shell.
$(RED Deprecated. Please use $(LREF spawnShell) or $(LREF executeShell)
instead. This function will be removed in August 2015.)
- Returns: If $(D command) is null, returns nonzero if the _command
- interpreter is found, and zero otherwise. If $(D command) is not
+ Returns: If `command` is null, returns nonzero if the _command
+ interpreter is found, and zero otherwise. If `command` is not
null, returns -1 on error, or the exit status of command (which may
in turn signal an error in command's execution).
Note: On Unix systems, the homonym C function (which is accessible
to D programs as $(LINK2 core_stdc_stdlib.html, core.stdc.stdlib._system))
returns a code in the same format as $(LUCKY waitpid, waitpid),
- meaning that C programs must use the $(D WEXITSTATUS) macro to
- extract the actual exit code from the $(D system) call. D's $(D
+ meaning that C programs must use the `WEXITSTATUS` macro to
+ extract the actual exit code from the `system` call. D's $(D
system) automatically extracts the exit status.
*/
@@ -3284,8 +3284,8 @@ private
version (StdDdoc)
{
/**
- Replaces the current process by executing a command, $(D pathname), with
- the arguments in $(D argv).
+ Replaces the current process by executing a command, `pathname`, with
+ the arguments in `argv`.
$(RED Deprecated on Windows. From August 2015, these functions will
only be available on POSIX platforms. The reason is that they never
@@ -3293,9 +3293,9 @@ version (StdDdoc)
possible to implement such behaviour on Windows. See below for more
information.)
- Typically, the first element of $(D argv) is
+ Typically, the first element of `argv` is
the command being executed, i.e. $(D argv[0] == pathname). The 'p'
- versions of $(D exec) search the PATH environment variable for $(D
+ versions of `exec` search the PATH environment variable for $(D
pathname). The 'e' versions additionally take the new process'
environment variables as an array of strings of the form key=value.
@@ -3307,7 +3307,7 @@ version (StdDdoc)
These functions are only supported on POSIX platforms, as the Windows
operating systems do not provide the ability to overwrite the current
process image with another. In single-threaded programs it is possible
- to approximate the effect of $(D execv*) by using $(LREF spawnProcess)
+ to approximate the effect of `execv*` by using $(LREF spawnProcess)
and terminating the current process once the child process has returned.
For example:
---
@@ -3323,7 +3323,7 @@ version (StdDdoc)
_exit(wait(spawnProcess(commandLine)));
}
---
- This is, however, NOT equivalent to POSIX' $(D execv*). For one thing, the
+ This is, however, NOT equivalent to POSIX' `execv*`. For one thing, the
executed program is started as a separate process, with all this entails.
Secondly, in a multithreaded program, other threads will continue to do
work while the current thread is waiting for the child process to complete.
@@ -3332,7 +3332,7 @@ version (StdDdoc)
after spawning the child process. This is the behaviour exhibited by the
$(LINK2 http://msdn.microsoft.com/en-us/library/431x4c1w.aspx,$(D __exec))
functions in Microsoft's C runtime library, and it is how D's now-deprecated
- Windows $(D execv*) functions work. Example:
+ Windows `execv*` functions work. Example:
---
auto commandLine = [ "program", "arg1", "arg2" ];
version (Posix)
@@ -3570,7 +3570,7 @@ deprecated unittest
}
/**
-Gets the value of environment variable $(D name) as a string. Calls
+Gets the value of environment variable `name` as a string. Calls
$(LINK2 core_stdc_stdlib.html#_getenv, core.stdc.stdlib._getenv)
internally.
@@ -3592,7 +3592,7 @@ string getenv(in char[] name) nothrow
}
/**
-Sets the value of environment variable $(D name) to $(D value). If the
+Sets the value of environment variable `name` to `value`. If the
value was written, or the variable was already present and $(D
overwrite) is false, returns normally. Otherwise, it throws an
exception. Calls $(LINK2 core_sys_posix_stdlib.html#_setenv,
@@ -3611,7 +3611,7 @@ else version(Posix)
}
/**
-Removes variable $(D name) from the environment. Calls $(LINK2
+Removes variable `name` from the environment. Calls $(LINK2
core_sys_posix_stdlib.html#_unsetenv, core.sys.posix.stdlib._unsetenv) internally.
$(RED Deprecated. Please use $(LREF environment.remove) instead.
diff --git a/std/random.d b/std/random.d
index 75496aca623..60998a1daa0 100644
--- a/std/random.d
+++ b/std/random.d
@@ -10,7 +10,7 @@ numbers. An overall fast and reliable means to generate random numbers
is the $(D_PARAM Mt19937) generator, which derives its name from
"$(LUCKY Mersenne Twister) with a period of 2 to the power of
19937". In memory-constrained situations, $(LUCKY linear congruential)
-generators such as $(D MinstdRand0) and $(D MinstdRand) might be
+generators such as `MinstdRand0` and `MinstdRand` might be
useful. The standard library provides an alias $(D_PARAM Random) for
whichever generator it considers the most fit for the target
environment.
@@ -33,7 +33,7 @@ integers and real numbers have been implemented.
Upgrading:
$(WEB digitalmars.com/d/1.0/phobos/std_random.html#rand) can
- be replaced with $(D uniform!uint()).
+ be replaced with `uniform!uint()`.
Source: $(PHOBOSSRC std/_random.d)
@@ -257,7 +257,7 @@ struct LinearCongruentialEngine(UIntType, UIntType a, UIntType c, UIntType m)
enum bool isUniformRandom = true;
/// Does this generator have a fixed range? ($(D_PARAM true)).
enum bool hasFixedRange = true;
- /// Lowest generated value ($(D 1) if $(D c == 0), $(D 0) otherwise).
+ /// Lowest generated value (`1` if $(D c == 0), `0` otherwise).
enum UIntType min = ( c == 0 ? 1 : 0 );
/// Highest generated value ($(D modulus - 1)).
enum UIntType max = m - 1;
@@ -349,7 +349,7 @@ The parameters of this distribution. The random number is $(D_PARAM x
/**
Constructs a $(D_PARAM LinearCongruentialEngine) generator seeded with
-$(D x0).
+`x0`.
*/
this(UIntType x0) @safe pure
{
@@ -422,7 +422,7 @@ $(D x0).
}
/**
-Always $(D false) (random generators are infinite ranges).
+Always `false` (random generators are infinite ranges).
*/
enum bool empty = false;
@@ -439,10 +439,10 @@ Always $(D false) (random generators are infinite ranges).
/**
Define $(D_PARAM LinearCongruentialEngine) generators with well-chosen
-parameters. $(D MinstdRand0) implements Park and Miller's "minimal
+parameters. `MinstdRand0` implements Park and Miller's "minimal
standard" $(WEB
wikipedia.org/wiki/Park%E2%80%93Miller_random_number_generator,
-generator) that uses 16807 for the multiplier. $(D MinstdRand)
+generator) that uses 16807 for the multiplier. `MinstdRand`
implements a variant that has slightly better spectral behavior by
using the multiplier 48271. Both generators are rather simplistic.
@@ -611,7 +611,7 @@ Parameters for the generator.
Seeds a MersenneTwisterEngine object using an InputRange.
Throws:
- $(D Exception) if the InputRange didn't provide enough elements to seed the generator.
+ `Exception` if the InputRange didn't provide enough elements to seed the generator.
The number of elements required is the 'n' template parameter of the MersenneTwisterEngine struct.
Examples:
@@ -706,7 +706,7 @@ Parameters for the generator.
}
/**
-Always $(D false).
+Always `false`.
*/
enum bool empty = false;
@@ -716,7 +716,7 @@ Always $(D false).
}
/**
-A $(D MersenneTwisterEngine) instantiated with the parameters of the
+A `MersenneTwisterEngine` instantiated with the parameters of the
original engine $(WEB math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html,
MT19937), generating uniformly-distributed 32-bit numbers with a
period of 2 to the power of 19937. Recommended for random number
@@ -816,7 +816,7 @@ unittest
*
* Implemented according to $(WEB www.jstatsoft.org/v08/i14/paper, Xorshift RNGs).
*
- * $(BOOKTABLE $(TEXTWITHCOMMAS Supporting bits are below, $(D bits) means second parameter of XorshiftEngine.),
+ * $(BOOKTABLE $(TEXTWITHCOMMAS Supporting bits are below, `bits` means second parameter of XorshiftEngine.),
* $(TR $(TH bits) $(TH period))
* $(TR $(TD 32) $(TD 2^32 - 1))
* $(TR $(TD 64) $(TD 2^64 - 1))
@@ -836,7 +836,7 @@ struct XorshiftEngine(UIntType, UIntType bits, UIntType a, UIntType b, UIntType
public:
///Mark this as a Rng
enum bool isUniformRandom = true;
- /// Always $(D false) (random generators are infinite ranges).
+ /// Always `false` (random generators are infinite ranges).
enum empty = false;
/// Smallest generated value.
enum UIntType min = 0;
@@ -871,7 +871,7 @@ struct XorshiftEngine(UIntType, UIntType bits, UIntType a, UIntType b, UIntType
public:
/**
- * Constructs a $(D XorshiftEngine) generator seeded with $(D_PARAM x0).
+ * Constructs a `XorshiftEngine` generator seeded with $(D_PARAM x0).
*/
@safe
nothrow this(UIntType x0) pure
@@ -1019,8 +1019,8 @@ struct XorshiftEngine(UIntType, UIntType bits, UIntType a, UIntType b, UIntType
/**
- * Define $(D XorshiftEngine) generators with well-chosen parameters. See each bits examples of "Xorshift RNGs".
- * $(D Xorshift) is a Xorshift128's alias because 128bits implementation is mostly used.
+ * Define `XorshiftEngine` generators with well-chosen parameters. See each bits examples of "Xorshift RNGs".
+ * `Xorshift` is a Xorshift128's alias because 128bits implementation is mostly used.
*
* Example:
* -----
@@ -1197,22 +1197,22 @@ A singleton instance of the default random number generator
}
/**
-Generates a number between $(D a) and $(D b). The $(D boundaries)
+Generates a number between `a` and `b`. The `boundaries`
parameter controls the shape of the interval (open vs. closed on
-either side). Valid values for $(D boundaries) are $(D "[]"), $(D
-"$(LPAREN)]"), $(D "[$(RPAREN)"), and $(D "()"). The default interval
+either side). Valid values for `boundaries` are `"[]"`, $(D
+"$(LPAREN)]"), $(D "[$(RPAREN)"), and `"()"`. The default interval
is closed to the left and open to the right. The version that does not
-take $(D urng) uses the default generator $(D rndGen).
+take `urng` uses the default generator `rndGen`.
Params:
a = lower bound of the _uniform distribution
b = upper bound of the _uniform distribution
urng = (optional) random number generator to use;
- if not specified, defaults to $(D rndGen)
+ if not specified, defaults to `rndGen`
Returns:
A single random variate drawn from the _uniform distribution
- between $(D a) and $(D b), whose type is the common type of
+ between `a` and `b`, whose type is the common type of
these parameters
Example:
@@ -1560,16 +1560,16 @@ if ((isIntegral!(CommonType!(T1, T2)) || isSomeChar!(CommonType!(T1, T2))) &&
/**
Generates a uniformly-distributed number in the range $(D [T.min,
-T.max]) for any integral or character type $(D T). If no random
-number generator is passed, uses the default $(D rndGen).
+T.max]) for any integral or character type `T`. If no random
+number generator is passed, uses the default `rndGen`.
Params:
urng = (optional) random number generator to use;
- if not specified, defaults to $(D rndGen)
+ if not specified, defaults to `rndGen`
Returns:
Random variate drawn from the _uniform distribution across all
- possible values of the integral or character type $(D T).
+ possible values of the integral or character type `T`.
*/
auto uniform(T, UniformRandomNumberGenerator)
(ref UniformRandomNumberGenerator urng)
@@ -1628,16 +1628,16 @@ if (!is(T == enum) && (isIntegral!T || isSomeChar!T))
}
/**
-Returns a uniformly selected member of enum $(D E). If no random number
-generator is passed, uses the default $(D rndGen).
+Returns a uniformly selected member of enum `E`. If no random number
+generator is passed, uses the default `rndGen`.
Params:
urng = (optional) random number generator to use;
- if not specified, defaults to $(D rndGen)
+ if not specified, defaults to `rndGen`
Returns:
Random variate drawn with equal probability from any
- of the possible values of the enum $(D E).
+ of the possible values of the enum `E`.
*/
auto uniform(E, UniformRandomNumberGenerator)
(ref UniformRandomNumberGenerator urng)
@@ -1675,20 +1675,20 @@ if (is(E == enum))
/**
* Generates a uniformly-distributed floating point number of type
- * $(D T) in the range [0, 1$(RPAREN). If no random number generator is
- * specified, the default RNG $(D rndGen) will be used as the source
+ * `T` in the range [0, 1$(RPAREN). If no random number generator is
+ * specified, the default RNG `rndGen` will be used as the source
* of randomness.
*
- * $(D uniform01) offers a faster generation of random variates than
+ * `uniform01` offers a faster generation of random variates than
* the equivalent $(D uniform!"[$(RPAREN)"(0.0, 1.0)) and so may be preferred
* for some applications.
*
* Params:
* urng = (optional) random number generator to use;
- * if not specified, defaults to $(D rndGen)
+ * if not specified, defaults to `rndGen`
*
* Returns:
- * Floating-point random variate of type $(D T) drawn from the _uniform
+ * Floating-point random variate of type `T` drawn from the _uniform
* distribution across the half-open interval [0, 1$(RPAREN).
*
*/
@@ -1786,9 +1786,9 @@ body
}
/**
-Generates a uniform probability distribution of size $(D n), i.e., an
-array of size $(D n) of positive numbers of type $(D F) that sum to
-$(D 1). If $(D useThis) is provided, it is used as storage.
+Generates a uniform probability distribution of size `n`, i.e., an
+array of size `n` of positive numbers of type `F` that sum to
+`1`. If `useThis` is provided, it is used as storage.
*/
F[] uniformDistribution(F = double)(size_t n, F[] useThis = null)
if(isFloatingPoint!F)
@@ -1817,14 +1817,14 @@ F[] uniformDistribution(F = double)(size_t n, F[] useThis = null)
}
/**
-Shuffles elements of $(D r) using $(D gen) as a shuffler. $(D r) must be
-a random-access range with length. If no RNG is specified, $(D rndGen)
+Shuffles elements of `r` using `gen` as a shuffler. `r` must be
+a random-access range with length. If no RNG is specified, `rndGen`
will be used.
Params:
r = random-access range whose elements are to be shuffled
gen = (optional) random number generator to use; if not
- specified, defaults to $(D rndGen)
+ specified, defaults to `rndGen`
*/
void randomShuffle(Range, RandomGen)(Range r, ref RandomGen gen)
@@ -1859,22 +1859,22 @@ unittest
}
/**
-Partially shuffles the elements of $(D r) such that upon returning $(D r[0..n])
-is a random subset of $(D r) and is randomly ordered. $(D r[n..r.length])
-will contain the elements not in $(D r[0..n]). These will be in an undefined
+Partially shuffles the elements of `r` such that upon returning `r[0..n]`
+is a random subset of `r` and is randomly ordered. `r[n..r.length]`
+will contain the elements not in `r[0..n]`. These will be in an undefined
order, but will not be random in the sense that their order after
-$(D partialShuffle) returns will not be independent of their order before
-$(D partialShuffle) was called.
+`partialShuffle` returns will not be independent of their order before
+`partialShuffle` was called.
-$(D r) must be a random-access range with length. $(D n) must be less than
-or equal to $(D r.length). If no RNG is specified, $(D rndGen) will be used.
+`r` must be a random-access range with length. `n` must be less than
+or equal to `r.length`. If no RNG is specified, `rndGen` will be used.
Params:
r = random-access range whose elements are to be shuffled
- n = number of elements of $(D r) to shuffle (counting from the beginning);
- must be less than $(D r.length)
+ n = number of elements of `r` to shuffle (counting from the beginning);
+ must be less than `r.length`
gen = (optional) random number generator to use; if not
- specified, defaults to $(D rndGen)
+ specified, defaults to `rndGen`
*/
void partialShuffle(Range, RandomGen)(Range r, in size_t n, ref RandomGen gen)
if(isRandomAccessRange!Range && isUniformRNG!RandomGen)
@@ -1916,11 +1916,11 @@ unittest
/**
Rolls a dice with relative probabilities stored in $(D
-proportions). Returns the index in $(D proportions) that was chosen.
+proportions). Returns the index in `proportions` that was chosen.
Params:
rnd = (optional) random number generator to use; if not
- specified, defaults to $(D rndGen)
+ specified, defaults to `rndGen`
proportions = forward range or list of individual values
whose elements correspond to the probabilities
with which to choose the corresponding index
@@ -1928,9 +1928,9 @@ Params:
Returns:
Random variate drawn from the index values
- [0, ... $(D proportions.length) - 1], with the probability
- of getting an individual index value $(D i) being proportional to
- $(D proportions[i]).
+ [0, ... `proportions.length` - 1], with the probability
+ of getting an individual index value `i` being proportional to
+ `proportions[i]`.
Example:
@@ -2009,22 +2009,22 @@ unittest
}
/**
-Covers a given range $(D r) in a random manner, i.e. goes through each
-element of $(D r) once and only once, just in a random order. $(D r)
+Covers a given range `r` in a random manner, i.e. goes through each
+element of `r` once and only once, just in a random order. `r`
must be a random-access range with length.
-If no random number generator is passed to $(D randomCover), the
+If no random number generator is passed to `randomCover`, the
thread-global RNG rndGen will be used internally.
Params:
r = random-access range to cover
rng = (optional) random number generator to use;
- if not specified, defaults to $(D rndGen)
+ if not specified, defaults to `rndGen`
Returns:
- Range whose elements consist of the elements of $(D r),
- in random order. Will be a forward range if both $(D r) and
- $(D rng) are forward ranges, an input range otherwise.
+ Range whose elements consist of the elements of `r`,
+ in random order. Will be a forward range if both `r` and
+ `rng` are forward ranges, an input range otherwise.
Example:
----
@@ -2236,49 +2236,49 @@ unittest
// RandomSample
/**
-Selects a random subsample out of $(D r), containing exactly $(D n)
+Selects a random subsample out of `r`, containing exactly `n`
elements. The order of elements is the same as in the original
-range. The total length of $(D r) must be known. If $(D total) is
+range. The total length of `r` must be known. If `total` is
passed in, the total number of sample is considered to be $(D
-total). Otherwise, $(D RandomSample) uses $(D r.length).
+total). Otherwise, `RandomSample` uses `r.length`.
Params:
r = range to sample from
n = number of elements to include in the sample;
must be less than or equal to the total number
- of elements in $(D r) and/or the parameter
- $(D total) (if provided)
- total = (semi-optional) number of elements of $(D r)
+ of elements in `r` and/or the parameter
+ `total` (if provided)
+ total = (semi-optional) number of elements of `r`
from which to select the sample (counting from
the beginning); must be less than or equal to
- the total number of elements in $(D r) itself.
- May be omitted if $(D r) has the $(D .length)
+ the total number of elements in `r` itself.
+ May be omitted if `r` has the `.length`
property and the sample is to be drawn from
- all elements of $(D r).
+ all elements of `r`.
rng = (optional) random number generator to use;
- if not specified, defaults to $(D rndGen)
+ if not specified, defaults to `rndGen`
Returns:
Range whose elements consist of a randomly selected subset of
- the elements of $(D r), in the same order as these elements
- appear in $(D r) itself. Will be a forward range if both $(D r)
- and $(D rng) are forward ranges, an input range otherwise.
+ the elements of `r`, in the same order as these elements
+ appear in `r` itself. Will be a forward range if both `r`
+ and `rng` are forward ranges, an input range otherwise.
-$(D RandomSample) implements Jeffrey Scott Vitter's Algorithm D
+`RandomSample` implements Jeffrey Scott Vitter's Algorithm D
(see Vitter $(WEB dx.doi.org/10.1145/358105.893, 1984), $(WEB
dx.doi.org/10.1145/23002.23003, 1987)), which selects a sample
-of size $(D n) in O(n) steps and requiring O(n) random variates,
+of size `n` in O(n) steps and requiring O(n) random variates,
regardless of the size of the data being sampled. The exception
to this is if traversing k elements on the input range is itself
an O(k) operation (e.g. when sampling lines from an input file),
in which case the sampling calculation will inevitably be of
O(total).
-RandomSample will throw an exception if $(D total) is verifiably
+RandomSample will throw an exception if `total` is verifiably
less than the total number of elements available in the input,
or if $(D n > total).
-If no random number generator is passed to $(D randomSample), the
+If no random number generator is passed to `randomSample`, the
thread-global RNG rndGen will be used internally.
Example:
diff --git a/std/range/interfaces.d b/std/range/interfaces.d
index 5ee24a4c008..cc221e996b1 100644
--- a/std/range/interfaces.d
+++ b/std/range/interfaces.d
@@ -1,11 +1,11 @@
/**
This module is a submodule of $(LINK2 std_range_package.html, std.range).
-The main $(D std.range) module provides template-based tools for working with
+The main `std.range` module provides template-based tools for working with
ranges, but sometimes an object-based interface for ranges is needed, such as
when runtime polymorphism is required. For this purpose, this submodule
-provides a number of object and $(D interface) definitions that can be used to
-wrap around _range objects created by the $(D std.range) templates.
+provides a number of object and `interface` definitions that can be used to
+wrap around _range objects created by the `std.range` templates.
$(BOOKTABLE ,
$(TR $(TD $(D $(LREF InputRange)))
@@ -39,11 +39,11 @@ $(BOOKTABLE ,
$(TD Wrapper for output ranges.
))
$(TR $(TD $(D $(LREF OutputRangeObject)))
- $(TD Class that implements the $(D OutputRange) interface and wraps the
- $(D put) methods in virtual functions.
+ $(TD Class that implements the `OutputRange` interface and wraps the
+ `put` methods in virtual functions.
))
$(TR $(TD $(D $(LREF InputRangeObject)))
- $(TD Class that implements the $(D InputRange) interface and wraps the
+ $(TD Class that implements the `InputRange` interface and wraps the
input _range methods in virtual functions.
))
$(TR $(TD $(D $(LREF RefRange)))
@@ -77,7 +77,7 @@ import std.typetuple;
* binary interface is required, such as when a DLL function or virtual function
* needs to accept a generic range as a parameter. Note that
* $(LREF isInputRange) and friends check for conformance to structural
- * interfaces, not for implementation of these $(D interface) types.
+ * interfaces, not for implementation of these `interface` types.
*
* Examples:
* ---
@@ -97,7 +97,7 @@ import std.typetuple;
*
* Limitations:
*
- * These interfaces are not capable of forwarding $(D ref) access to elements.
+ * These interfaces are not capable of forwarding `ref` access to elements.
*
* Infiniteness of the wrapped range is not propagated.
*
@@ -128,7 +128,7 @@ interface InputRange(E) {
* InputRangeObject, range primitives: 877 milliseconds (3.15x penalty)
*/
- /**$(D foreach) iteration uses opApply, since one delegate call per loop
+ /**`foreach` iteration uses opApply, since one delegate call per loop
* iteration is faster than three virtual function calls.
*/
int opApply(int delegate(E));
@@ -138,13 +138,13 @@ interface InputRange(E) {
}
-/**Interface for a forward range of type $(D E).*/
+/**Interface for a forward range of type `E`.*/
interface ForwardRange(E) : InputRange!E {
///
@property ForwardRange!E save();
}
-/**Interface for a bidirectional range of type $(D E).*/
+/**Interface for a bidirectional range of type `E`.*/
interface BidirectionalRange(E) : ForwardRange!(E) {
///
@property BidirectionalRange!E save();
@@ -159,7 +159,7 @@ interface BidirectionalRange(E) : ForwardRange!(E) {
void popBack();
}
-/**Interface for a finite random access range of type $(D E).*/
+/**Interface for a finite random access range of type `E`.*/
interface RandomAccessFinite(E) : BidirectionalRange!(E) {
///
@property RandomAccessFinite!E save();
@@ -184,7 +184,7 @@ interface RandomAccessFinite(E) : BidirectionalRange!(E) {
}
}
-/**Interface for an infinite random access range of type $(D E).*/
+/**Interface for an infinite random access range of type `E`.*/
interface RandomAccessInfinite(E) : ForwardRange!E {
///
E moveAt(size_t);
@@ -226,8 +226,8 @@ interface RandomFiniteAssignable(E) : RandomAccessFinite!E, BidirectionalAssigna
void opIndexAssign(E val, size_t index);
}
-/**Interface for an output range of type $(D E). Usage is similar to the
- * $(D InputRange) interface and descendants.*/
+/**Interface for an output range of type `E`. Usage is similar to the
+ * `InputRange` interface and descendants.*/
interface OutputRange(E) {
///
void put(E);
@@ -256,8 +256,8 @@ private string putMethods(E...)()
return ret;
}
-/**Implements the $(D OutputRange) interface for all types E and wraps the
- * $(D put) method for each type $(D E) in a virtual function.
+/**Implements the `OutputRange` interface for all types E and wraps the
+ * `put` method for each type `E` in a virtual function.
*/
class OutputRangeObject(R, E...) : staticMap!(OutputRange, E) {
// @BUG 4689: There should be constraints on this template class, but
@@ -272,7 +272,7 @@ class OutputRangeObject(R, E...) : staticMap!(OutputRange, E) {
}
-/**Returns the interface type that best matches $(D R).*/
+/**Returns the interface type that best matches `R`.*/
template MostDerivedInputRange(R) if (isInputRange!(Unqual!R)) {
private alias E = ElementType!R;
@@ -305,9 +305,9 @@ template MostDerivedInputRange(R) if (isInputRange!(Unqual!R)) {
}
}
-/**Implements the most derived interface that $(D R) works with and wraps
- * all relevant range primitives in virtual functions. If $(D R) is already
- * derived from the $(D InputRange) interface, aliases itself away.
+/**Implements the most derived interface that `R` works with and wraps
+ * all relevant range primitives in virtual functions. If `R` is already
+ * derived from the `InputRange` interface, aliases itself away.
*/
template InputRangeObject(R) if (isInputRange!(Unqual!R)) {
static if (is(R : InputRange!(ElementType!R))) {
@@ -424,7 +424,7 @@ template InputRangeObject(R) if (isInputRange!(Unqual!R)) {
}
}
-/**Convenience function for creating an $(D InputRangeObject) of the proper type.
+/**Convenience function for creating an `InputRangeObject` of the proper type.
* See $(LREF InputRange) for an example.
*/
InputRangeObject!R inputRangeObject(R)(R range) if (isInputRange!R) {
@@ -435,8 +435,8 @@ InputRangeObject!R inputRangeObject(R)(R range) if (isInputRange!R) {
}
}
-/**Convenience function for creating an $(D OutputRangeObject) with a base range
- * of type $(D R) that accepts types $(D E).
+/**Convenience function for creating an `OutputRangeObject` with a base range
+ * of type `R` that accepts types `E`.
Examples:
---
diff --git a/std/range/package.d b/std/range/package.d
index 2a39488a2ee..2d394452d15 100644
--- a/std/range/package.d
+++ b/std/range/package.d
@@ -55,8 +55,8 @@ $(BOOKTABLE ,
elements of the given _range.
))
$(TR $(TD $(D $(LREF takeExactly)))
- $(TD Like $(D take), but assumes the given _range actually has $(I n)
- elements, and therefore also defines the $(D length) property.
+ $(TD Like `take`, but assumes the given _range actually has $(I n)
+ elements, and therefore also defines the `length` property.
))
$(TR $(TD $(D $(LREF takeOne)))
$(TD Creates a random-access _range consisting of exactly the first
@@ -92,16 +92,16 @@ $(BOOKTABLE ,
etc.
))
$(TR $(TD $(D $(LREF lockstep)))
- $(TD Iterates $(I n) _ranges in lockstep, for use in a $(D foreach)
- loop. Similar to $(D zip), except that $(D lockstep) is designed
- especially for $(D foreach) loops.
+ $(TD Iterates $(I n) _ranges in lockstep, for use in a `foreach`
+ loop. Similar to `zip`, except that `lockstep` is designed
+ especially for `foreach` loops.
))
$(TR $(TD $(D $(LREF recurrence)))
$(TD Creates a forward _range whose values are defined by a
mathematical recurrence relation.
))
$(TR $(TD $(D $(LREF sequence)))
- $(TD Similar to $(D recurrence), except that a random-access _range is
+ $(TD Similar to `recurrence`, except that a random-access _range is
created.
))
$(TR $(TD $(D $(LREF iota)))
@@ -145,8 +145,8 @@ $(BOOKTABLE ,
Ranges whose elements are sorted afford better efficiency with certain
operations. For this, the $(D $(LREF assumeSorted)) function can be used to
construct a $(D $(LREF SortedRange)) from a pre-sorted _range. The $(LINK2
-std_algorithm.html#sort, $(D std.algorithm.sort)) function also conveniently
-returns a $(D SortedRange). $(D SortedRange) objects provide some additional
+std_algorithm.html#sort, `std.algorithm.sort`) function also conveniently
+returns a `SortedRange`. `SortedRange` objects provide some additional
_range operations that take advantage of the fact that the _range is sorted.
Source: $(PHOBOSSRC std/_range/_package.d)
@@ -176,7 +176,7 @@ import std.typetuple;
/**
Iterates a bidirectional range backwards. The original range can be
-accessed by using the $(D source) property. Applying retro twice to
+accessed by using the `source` property. Applying retro twice to
the same range yields the original range.
*/
auto retro(Range)(Range r)
@@ -400,13 +400,13 @@ if (isBidirectionalRange!(Unqual!Range))
/**
-Iterates range $(D r) with stride $(D n). If the range is a
+Iterates range `r` with stride `n`. If the range is a
random-access range, moves by indexing into the range; otherwise,
-moves by successive calls to $(D popFront). Applying stride twice to
+moves by successive calls to `popFront`. Applying stride twice to
the same range results in a stride with a step that is the
product of the two applications.
-Throws: $(D Exception) if $(D n == 0).
+Throws: `Exception` if $(D n == 0).
Example:
----
@@ -760,14 +760,14 @@ if (isInputRange!(Unqual!Range))
}
/**
-Spans multiple ranges in sequence. The function $(D chain) takes any
+Spans multiple ranges in sequence. The function `chain` takes any
number of ranges and returns a $(D Chain!(R1, R2,...)) object. The
ranges may be different, but they must have the same element type. The
-result is a range that offers the $(D front), $(D popFront), and $(D
+result is a range that offers the `front`, `popFront`, and $(D
empty) primitives. If all input ranges offer random access and $(D
-length), $(D Chain) offers them as well.
+length), `Chain` offers them as well.
-If only one range is offered to $(D Chain) or $(D chain), the $(D
+If only one range is offered to `Chain` or `chain`, the $(D
Chain) type exits the picture by aliasing itself directly to that
range's type.
@@ -1204,10 +1204,10 @@ if (Ranges.length > 0 &&
}
/**
-$(D roundRobin(r1, r2, r3)) yields $(D r1.front), then $(D r2.front),
-then $(D r3.front), after which it pops off one element from each and
-continues again from $(D r1). For example, if two ranges are involved,
-it alternately yields elements off the two ranges. $(D roundRobin)
+$(D roundRobin(r1, r2, r3)) yields `r1.front`, then `r2.front`,
+then `r3.front`, after which it pops off one element from each and
+continues again from `r1`. For example, if two ranges are involved,
+it alternately yields elements off the two ranges. `roundRobin`
stops after it has consumed all ranges (skipping over the ones that
finish early).
*/
@@ -1398,9 +1398,9 @@ if (isRandomAccessRange!(Unqual!R) && hasLength!(Unqual!R))
}
/**
-Lazily takes only up to $(D n) elements of a range. This is
+Lazily takes only up to `n` elements of a range. This is
particularly useful when using with infinite ranges. If the range
-offers random access and $(D length), $(D Take) offers them as well.
+offers random access and `length`, `Take` offers them as well.
*/
struct Take(Range)
if (isInputRange!(Unqual!Range) &&
@@ -1723,13 +1723,13 @@ if (isInputRange!(Unqual!R) && (isInfinite!(Unqual!R) || !hasSlicing!(Unqual!R)
/**
-Similar to $(LREF take), but assumes that $(D range) has at least $(D
+Similar to $(LREF take), but assumes that `range` has at least $(D
n) elements. Consequently, the result of $(D takeExactly(range, n))
-always defines the $(D length) property (and initializes it to $(D n))
-even when $(D range) itself does not define $(D length).
+always defines the `length` property (and initializes it to `n`)
+even when `range` itself does not define `length`.
-The result of $(D takeExactly) is identical to that of $(LREF take) in
-cases where the original range defines $(D length) or is infinite.
+The result of `takeExactly` is identical to that of $(LREF take) in
+cases where the original range defines `length` or is infinite.
*/
auto takeExactly(R)(R range, size_t n)
if (isInputRange!R)
@@ -1919,15 +1919,15 @@ if (isInputRange!R)
/**
Returns a range with at most one element; for example, $(D
takeOne([42, 43, 44])) returns a range consisting of the integer $(D
-42). Calling $(D popFront()) off that range renders it empty.
+42). Calling `popFront()` off that range renders it empty.
-In effect $(D takeOne(r)) is somewhat equivalent to $(D take(r, 1)) but in
+In effect `takeOne(r)` is somewhat equivalent to $(D take(r, 1)) but in
certain interfaces it is important to know statically that the range may only
have at most one element.
-The type returned by $(D takeOne) is a random-access range with length
-regardless of $(D R)'s capabilities (another feature that distinguishes
-$(D takeOne) from $(D take)).
+The type returned by `takeOne` is a random-access range with length
+regardless of `R`'s capabilities (another feature that distinguishes
+`takeOne` from `take`).
*/
auto takeOne(R)(R source) if (isInputRange!R)
{
@@ -2000,7 +2000,7 @@ unittest
/++
Returns an empty range which is statically known to be empty and is
- guaranteed to have $(D length) and be random access regardless of $(D R)'s
+ guaranteed to have `length` and be random access regardless of `R`'s
capabilities.
+/
auto takeNone(R)()
@@ -2184,16 +2184,16 @@ auto takeNone(R)(R range)
/++
Convenience function which calls
- $(D range.$(LREF popFrontN)(n)) and returns $(D range). $(D drop)
+ $(D range.$(LREF popFrontN)(n)) and returns `range`. `drop`
makes it easier to pop elements from a range
and then pass it to another function within a single expression,
- whereas $(D popFrontN) would require multiple statements.
+ whereas `popFrontN` would require multiple statements.
- $(D dropBack) provides the same functionality but instead calls
- $(D range.popBackN(n)).
+ `dropBack` provides the same functionality but instead calls
+ `range.popBackN(n)`.
- Note: $(D drop) and $(D dropBack) will only pop $(I up to)
- $(D n) elements but will stop if the range is empty first.
+ Note: `drop` and `dropBack` will only pop $(I up to)
+ `n` elements but will stop if the range is empty first.
+/
R drop(R)(R range, size_t n)
@@ -2262,17 +2262,17 @@ R dropBack(R)(R range, size_t n)
}
/++
- Similar to $(LREF drop) and $(D dropBack) but they call
- $(D range.$(LREF popFrontExactly)(n)) and $(D range.popBackExactly(n))
+ Similar to $(LREF drop) and `dropBack` but they call
+ $(D range.$(LREF popFrontExactly)(n)) and `range.popBackExactly(n)`
instead.
- Note: Unlike $(D drop), $(D dropExactly) will assume that the
- range holds at least $(D n) elements. This makes $(D dropExactly)
- faster than $(D drop), but it also means that if $(D range) does
- not contain at least $(D n) elements, it will attempt to call $(D popFront)
+ Note: Unlike `drop`, `dropExactly` will assume that the
+ range holds at least `n` elements. This makes `dropExactly`
+ faster than `drop`, but it also means that if `range` does
+ not contain at least `n` elements, it will attempt to call `popFront`
on an empty range, which is undefined behavior. So, only use
- $(D popFrontExactly) when it is guaranteed that $(D range) holds at least
- $(D n) elements.
+ `popFrontExactly` when it is guaranteed that `range` holds at least
+ `n` elements.
+/
R dropExactly(R)(R range, size_t n)
if(isInputRange!R)
@@ -2308,13 +2308,13 @@ R dropBackExactly(R)(R range, size_t n)
/++
Convenience function which calls
- $(D range.popFront()) and returns $(D range). $(D dropOne)
+ `range.popFront()` and returns `range`. `dropOne`
makes it easier to pop an element from a range
and then pass it to another function within a single expression,
- whereas $(D popFront) would require multiple statements.
+ whereas `popFront` would require multiple statements.
- $(D dropBackOne) provides the same functionality but instead calls
- $(D range.popBack()).
+ `dropBackOne` provides the same functionality but instead calls
+ `range.popBack()`.
+/
R dropOne(R)(R range)
if (isInputRange!R)
@@ -2427,7 +2427,7 @@ Repeat!T repeat(T)(T value) { return Repeat!T(value); }
}
/**
- Repeats $(D value) exactly $(D n) times. Equivalent to $(D
+ Repeats `value` exactly `n` times. Equivalent to $(D
take(repeat(value), n)).
*/
Take!(Repeat!T) repeat(T)(T value, size_t n)
@@ -2460,11 +2460,11 @@ Take!(Repeat!T) repeat(T)(T value, size_t n)
/**
Repeats the given forward range ad infinitum. If the original range is
-infinite (fact that would make $(D Cycle) the identity application),
-$(D Cycle) detects that and aliases itself to the range type
-itself. If the original range has random access, $(D Cycle) offers
+infinite (fact that would make `Cycle` the identity application),
+`Cycle` detects that and aliases itself to the range type
+itself. If the original range has random access, `Cycle` offers
random access and also offers a constructor taking an initial position
-$(D index). $(D Cycle) works with static arrays in addition to ranges,
+`index`. `Cycle` works with static arrays in addition to ranges,
mostly for performance reasons.
Tip: This is a great way to implement simple circular buffers.
@@ -2888,8 +2888,8 @@ private alias lengthType(R) = typeof(R.init.length.init);
/**
Iterate several ranges in lockstep. The element type is a proxy tuple
- that allows accessing the current element in the $(D n)th range by
- using $(D e[n]).
+ that allows accessing the current element in the `n`th range by
+ using `e[n]`.
Example:
----
@@ -2902,7 +2902,7 @@ private alias lengthType(R) = typeof(R.init.length.init);
}
----
- $(D Zip) offers the lowest range facilities of all components, e.g. it
+ `Zip` offers the lowest range facilities of all components, e.g. it
offers random access iff all ranges offer random access, and also
offers mutation and swapping if all ranges offer it. Due to this, $(D
Zip) is extremely powerful because it allows manipulating several
@@ -2931,7 +2931,7 @@ struct Zip(Ranges...)
}
/**
- Returns $(D true) if the range is at end. The test depends on the
+ Returns `true` if the range is at end. The test depends on the
stopping policy.
*/
static if (allSatisfy!(isInfinite, R))
@@ -3115,7 +3115,7 @@ struct Zip(Ranges...)
}
/**
- Calls $(D popBack) for all controlled ranges.
+ Calls `popBack` for all controlled ranges.
*/
static if (allSatisfy!(isBidirectionalRange, R))
{
@@ -3152,7 +3152,7 @@ struct Zip(Ranges...)
/**
Returns the length of this range. Defined only if all ranges define
- $(D length).
+ `length`.
*/
static if (allSatisfy!(hasLength, R))
{
@@ -3195,7 +3195,7 @@ struct Zip(Ranges...)
}
/**
- Returns the $(D n)th element in the composite range. Defined if all
+ Returns the `n`th element in the composite range. Defined if all
ranges offer random access.
*/
static if (allSatisfy!(isRandomAccessRange, R))
@@ -3210,7 +3210,7 @@ struct Zip(Ranges...)
}
/**
- Assigns to the $(D n)th element in the composite range. Defined if
+ Assigns to the `n`th element in the composite range. Defined if
all ranges offer random access.
*/
static if (allSatisfy!(hasAssignableElements, R))
@@ -3226,7 +3226,7 @@ struct Zip(Ranges...)
}
/**
- Destructively reads the $(D n)th element in the composite
+ Destructively reads the `n`th element in the composite
range. Defined if all ranges offer random access.
*/
static if (allSatisfy!(hasMobileElements, R))
@@ -3269,7 +3269,7 @@ auto zip(Ranges...)(StoppingPolicy sp, Ranges ranges)
}
/**
- Dictates how iteration in a $(D Zip) should stop. By default stop at
+ Dictates how iteration in a `Zip` should stop. By default stop at
the end of the shortest of all ranges.
*/
enum StoppingPolicy
@@ -3512,18 +3512,18 @@ private string lockstepMixin(Ranges...)(bool withIndex)
}
/**
- Iterate multiple ranges in lockstep using a $(D foreach) loop. If only a single
- range is passed in, the $(D Lockstep) aliases itself away. If the
- ranges are of different lengths and $(D s) == $(D StoppingPolicy.shortest)
+ Iterate multiple ranges in lockstep using a `foreach` loop. If only a single
+ range is passed in, the `Lockstep` aliases itself away. If the
+ ranges are of different lengths and `s` == `StoppingPolicy.shortest`
stop after the shortest range is empty. If the ranges are of different
- lengths and $(D s) == $(D StoppingPolicy.requireSameLength), throw an
- exception. $(D s) may not be $(D StoppingPolicy.longest), and passing this
+ lengths and `s` == `StoppingPolicy.requireSameLength`, throw an
+ exception. `s` may not be `StoppingPolicy.longest`, and passing this
will throw an exception.
- By default $(D StoppingPolicy) is set to $(D StoppingPolicy.shortest).
+ By default `StoppingPolicy` is set to `StoppingPolicy.shortest`.
- BUGS: If a range does not offer lvalue access, but $(D ref) is used in the
- $(D foreach) loop, it will be silently accepted but any modifications
+ BUGS: If a range does not offer lvalue access, but `ref` is used in the
+ `foreach` loop, it will be silently accepted but any modifications
to the variable will not be propagated to the underlying range.
// Lockstep also supports iterating with an index variable:
@@ -3683,11 +3683,11 @@ unittest
Creates a mathematical sequence given the initial values and a
recurrence function that computes the next value from the existing
values. The sequence comes in the form of an infinite forward
-range. The type $(D Recurrence) itself is seldom used directly; most
+range. The type `Recurrence` itself is seldom used directly; most
often, recurrences are obtained by calling the function $(D
recurrence).
-When calling $(D recurrence), the function that computes the next
+When calling `recurrence`, the function that computes the next
value is specified as a template argument, and the initial values in
the recurrence are passed as regular arguments. For example, in a
Fibonacci sequence, there are two initial values (and therefore a
@@ -3698,17 +3698,17 @@ The signature of this function should be:
----
auto fun(R)(R state, size_t n)
----
-where $(D n) will be the index of the current value, and $(D state) will be an
+where `n` will be the index of the current value, and `state` will be an
opaque state vector that can be indexed with array-indexing notation
-$(D state[i]), where valid values of $(D i) range from $(D (n - 1)) to
+`state[i]`, where valid values of `i` range from $(D (n - 1)) to
$(D (n - State.length)).
-If the function is passed in string form, the state has name $(D "a")
-and the zero-based index in the recurrence has name $(D "n"). The
-given string must return the desired value for $(D a[n]) given $(D a[n
+If the function is passed in string form, the state has name `"a"`
+and the zero-based index in the recurrence has name `"n"`. The
+given string must return the desired value for `a[n]` given $(D a[n
- 1]), $(D a[n - 2]), $(D a[n - 3]),..., $(D a[n - stateSize]). The
state size is dictated by the number of arguments passed to the call
-to $(D recurrence). The $(D Recurrence) struct itself takes care of
+to `recurrence`. The `Recurrence` struct itself takes care of
managing the recurrence's state and shifting it appropriately.
*/
struct Recurrence(alias fun, StateType, size_t stateSize)
@@ -3806,15 +3806,15 @@ recurrence(alias fun, State...)(State initial)
}
/**
- $(D Sequence) is similar to $(D Recurrence) except that iteration is
+ `Sequence` is similar to `Recurrence` except that iteration is
presented in the so-called $(WEB en.wikipedia.org/wiki/Closed_form,
- closed form). This means that the $(D n)th element in the series is
- computable directly from the initial values and $(D n) itself. This
- implies that the interface offered by $(D Sequence) is a random-access
- range, as opposed to the regular $(D Recurrence), which only offers
+ closed form). This means that the `n`th element in the series is
+ computable directly from the initial values and `n` itself. This
+ implies that the interface offered by `Sequence` is a random-access
+ range, as opposed to the regular `Recurrence`, which only offers
forward iteration.
- The state of the sequence is stored as a $(D Tuple) so it can be
+ The state of the sequence is stored as a `Tuple` so it can be
heterogeneous.
*/
struct Sequence(alias fun, State)
@@ -3990,19 +3990,19 @@ unittest
step = The value to add to the current value at each iteration.
Returns:
- A range that goes through the numbers $(D begin), $(D begin + step),
- $(D begin + 2 * step), $(D ...), up to and excluding $(D end).
+ A range that goes through the numbers `begin`, $(D begin + step),
+ $(D begin + 2 * step), `...`, up to and excluding `end`.
The two-argument overloads have $(D step = 1). If $(D begin < end && step <
0) or $(D begin > end && step > 0) or $(D begin == end), then an empty range
is returned.
For built-in types, the range returned is a random access range. For
- user-defined types that support $(D ++), the range is an input
+ user-defined types that support `++`, the range is an input
range.
Throws:
- $(D Exception) if $(D begin != end && step == 0), an exception is
+ `Exception` if $(D begin != end && step == 0), an exception is
thrown.
*/
auto iota(B, E, S)(B begin, E end, S step)
@@ -4489,7 +4489,7 @@ auto iota(B, E)(B begin, E end)
/**
User-defined types such as $(XREF bigint, BigInt) are also supported, as long
-as they can be incremented with $(D ++) and compared with $(D <) or $(D ==).
+as they can be incremented with `++` and compared with `<` or `==`.
*/
// Issue 6447
unittest
@@ -4662,7 +4662,7 @@ struct FrontTransversal(Ror,
}
/**
- Duplicates this $(D frontTransversal). Note that only the encapsulating
+ Duplicates this `frontTransversal`. Note that only the encapsulating
range of range will be duplicated. Underlying ranges will not be
duplicated.
*/
@@ -4744,7 +4744,7 @@ struct FrontTransversal(Ror,
}
/**
- Slicing if offered if $(D RangeOfRanges) supports slicing and all the
+ Slicing if offered if `RangeOfRanges` supports slicing and all the
conditions for supporting indexing are met.
*/
static if (hasSlicing!RangeOfRanges)
@@ -5040,7 +5040,7 @@ struct Transversal(Ror,
}
/**
- Slicing if offered if $(D RangeOfRanges) supports slicing and all the
+ Slicing if offered if `RangeOfRanges` supports slicing and all the
conditions for supporting indexing are met.
*/
static if (hasSlicing!RangeOfRanges)
@@ -5278,13 +5278,13 @@ Transposed!RangeOfRanges transposed(RangeOfRanges)(RangeOfRanges rr)
}
/**
-This struct takes two ranges, $(D source) and $(D indices), and creates a view
-of $(D source) as if its elements were reordered according to $(D indices).
-$(D indices) may include only a subset of the elements of $(D source) and
+This struct takes two ranges, `source` and `indices`, and creates a view
+of `source` as if its elements were reordered according to `indices`.
+`indices` may include only a subset of the elements of `source` and
may also repeat elements.
-$(D Source) must be a random access range. The returned range will be
-bidirectional or random-access if $(D Indices) is bidirectional or
+`Source` must be a random access range. The returned range will be
+bidirectional or random-access if `Indices` is bidirectional or
random-access, respectively.
*/
struct Indexed(Source, Indices)
@@ -5463,7 +5463,7 @@ struct Indexed(Source, Indices)
/**
Returns the physical index into the source range corresponding to a
given logical index. This is useful, for example, when indexing
- an $(D Indexed) without adding another layer of indirection.
+ an `Indexed` without adding another layer of indirection.
Examples:
---
@@ -5532,12 +5532,12 @@ Indexed!(Source, Indices) indexed(Source, Indices)(Source source, Indices indice
}
/**
-This range iterates over fixed-sized chunks of size $(D chunkSize) of a
-$(D source) range. $(D Source) must be a forward range.
+This range iterates over fixed-sized chunks of size `chunkSize` of a
+`source` range. `Source` must be a forward range.
-If $(D !isInfinite!Source) and $(D source.walkLength) is not evenly
-divisible by $(D chunkSize), the back element of this range will contain
-fewer than $(D chunkSize) elements.
+If `!isInfinite!Source` and `source.walkLength` is not evenly
+divisible by `chunkSize`, the back element of this range will contain
+fewer than `chunkSize` elements.
*/
struct Chunks(Source)
if (isForwardRange!Source)
@@ -5582,7 +5582,7 @@ struct Chunks(Source)
static if (hasLength!Source)
{
- /// Length. Only if $(D hasLength!Source) is $(D true)
+ /// Length. Only if `hasLength!Source` is `true`
@property size_t length()
{
// Note: _source.length + _chunkSize may actually overflow.
@@ -5603,7 +5603,7 @@ struct Chunks(Source)
/**
Indexing and slicing operations. Provided only if
- $(D hasSlicing!Source) is $(D true).
+ `hasSlicing!Source` is `true`.
*/
auto opIndex(size_t index)
{
@@ -5713,7 +5713,7 @@ struct Chunks(Source)
{
/**
Bidirectional range primitives. Provided only if both
- $(D hasSlicing!Source) and $(D hasLength!Source) are $(D true).
+ `hasSlicing!Source` and `hasLength!Source` are `true`.
*/
@property auto back()
{
@@ -6020,7 +6020,7 @@ private struct OnlyResult(T, size_t arity : 0)
}
/**
-Assemble $(D values) into a range that carries all its
+Assemble `values` into a range that carries all its
elements in-situ.
Useful when a single value or multiple disconnected values
@@ -6225,27 +6225,27 @@ unittest
}
/**
-Iterate over $(D range) with an attached index variable.
+Iterate over `range` with an attached index variable.
Each element is a $(XREF typecons, Tuple) containing the index
-and the element, in that order, where the index member is named $(D index)
-and the element member is named $(D value).
+and the element, in that order, where the index member is named `index`
+and the element member is named `value`.
-The index starts at $(D start) and is incremented by one on every iteration.
+The index starts at `start` and is incremented by one on every iteration.
-Bidirectionality is propagated only if $(D range) has length.
+Bidirectionality is propagated only if `range` has length.
Overflow:
-If $(D range) has length, then it is an error to pass a value for $(D start)
-so that $(D start + range.length) is bigger than $(D Enumerator.max), thus it is
+If `range` has length, then it is an error to pass a value for `start`
+so that $(D start + range.length) is bigger than `Enumerator.max`, thus it is
ensured that overflow cannot happen.
-If $(D range) does not have length, and $(D popFront) is called when
+If `range` does not have length, and `popFront` is called when
$(D front.index == Enumerator.max), the index will overflow and
-continue from $(D Enumerator.min).
+continue from `Enumerator.min`.
Examples:
-Useful for using $(D foreach) with an index loop variable:
+Useful for using `foreach` with an index loop variable:
----
import std.stdio : stdin, stdout;
import std.range : enumerate;
@@ -6583,7 +6583,7 @@ version(none) // @@@BUG@@@ 10939
}
/**
- Returns true if $(D fn) accepts variables of type T1 and T2 in any order.
+ Returns true if `fn` accepts variables of type T1 and T2 in any order.
The following code should compile:
---
T1 foo();
@@ -6607,8 +6607,8 @@ template isTwoWayCompatible(alias fn, T1, T2)
/**
- Policy used with the searching primitives $(D lowerBound), $(D
- upperBound), and $(D equalRange) of $(LREF SortedRange) below.
+ Policy used with the searching primitives `lowerBound`, $(D
+ upperBound), and `equalRange` of $(LREF SortedRange) below.
*/
enum SearchPolicy
{
@@ -6642,21 +6642,21 @@ enum SearchPolicy
Searches using a classic interval halving policy. The search
starts in the middle of the range, and each search step cuts
the range in half. This policy finds a value in $(BIGOH log(n))
- time but is less cache friendly than $(D gallop) for large
- ranges. The $(D binarySearch) policy is used as the last step
- of $(D trot), $(D gallop), $(D trotBackwards), and $(D
+ time but is less cache friendly than `gallop` for large
+ ranges. The `binarySearch` policy is used as the last step
+ of `trot`, `gallop`, `trotBackwards`, and $(D
gallopBackwards) strategies.
*/
binarySearch,
/**
- Similar to $(D trot) but starts backwards. Use it when
+ Similar to `trot` but starts backwards. Use it when
confident that the value is around the end of the range.
*/
trotBackwards,
/**
- Similar to $(D gallop) but starts backwards. Use it when
+ Similar to `gallop` but starts backwards. Use it when
confident that the value is around the end of the range.
*/
gallopBackwards
@@ -6666,9 +6666,9 @@ enum SearchPolicy
Represents a sorted range. In addition to the regular range
primitives, supports additional operations that take advantage of the
ordering, such as merge and binary search. To obtain a $(D
-SortedRange) from an unsorted range $(D r), use $(XREF algorithm,
-sort) which sorts $(D r) in place and returns the corresponding $(D
-SortedRange). To construct a $(D SortedRange) from a range $(D r) that
+SortedRange) from an unsorted range `r`, use $(XREF algorithm,
+sort) which sorts `r` in place and returns the corresponding $(D
+SortedRange). To construct a `SortedRange` from a range `r` that
is known to be already sorted, use $(LREF assumeSorted) described
below.
*/
@@ -6903,10 +6903,10 @@ if (isInputRange!Range)
// lowerBound
/**
- This function uses a search with policy $(D sp) to find the
- largest left subrange on which $(D pred(x, value)) is $(D true) for
- all $(D x) (e.g., if $(D pred) is "less than", returns the portion of
- the range with elements strictly smaller than $(D value)). The search
+ This function uses a search with policy `sp` to find the
+ largest left subrange on which $(D pred(x, value)) is `true` for
+ all `x` (e.g., if `pred` is "less than", returns the portion of
+ the range with elements strictly smaller than `value`). The search
schedule and its complexity are documented in
$(LREF SearchPolicy). See also STL's
$(WEB sgi.com/tech/stl/lower_bound.html, lower_bound).
@@ -6927,16 +6927,16 @@ if (isInputRange!Range)
// upperBound
/**
-This function searches with policy $(D sp) to find the largest right
-subrange on which $(D pred(value, x)) is $(D true) for all $(D x)
-(e.g., if $(D pred) is "less than", returns the portion of the range
-with elements strictly greater than $(D value)). The search schedule
+This function searches with policy `sp` to find the largest right
+subrange on which $(D pred(value, x)) is `true` for all `x`
+(e.g., if `pred` is "less than", returns the portion of the range
+with elements strictly greater than `value`). The search schedule
and its complexity are documented in $(LREF SearchPolicy).
-For ranges that do not offer random access, $(D SearchPolicy.linear)
+For ranges that do not offer random access, `SearchPolicy.linear`
is the only policy allowed (and it must be specified explicitly lest it exposes
user code to unexpected inefficiencies). For random-access searches, all
-policies are allowed, and $(D SearchPolicy.binarySearch) is the default.
+policies are allowed, and `SearchPolicy.binarySearch` is the default.
See_Also: STL's $(WEB sgi.com/tech/stl/lower_bound.html,upper_bound).
@@ -6969,13 +6969,13 @@ assert(equal(p, [4, 4, 5, 6]));
// equalRange
/**
- Returns the subrange containing all elements $(D e) for which both $(D
- pred(e, value)) and $(D pred(value, e)) evaluate to $(D false) (e.g.,
- if $(D pred) is "less than", returns the portion of the range with
- elements equal to $(D value)). Uses a classic binary search with
+ Returns the subrange containing all elements `e` for which both $(D
+ pred(e, value)) and $(D pred(value, e)) evaluate to `false` (e.g.,
+ if `pred` is "less than", returns the portion of the range with
+ elements equal to `value`). Uses a classic binary search with
interval halving until it finds a value that satisfies the condition,
- then uses $(D SearchPolicy.gallopBackwards) to find the left boundary
- and $(D SearchPolicy.gallop) to find the right boundary. These
+ then uses `SearchPolicy.gallopBackwards` to find the left boundary
+ and `SearchPolicy.gallop` to find the right boundary. These
policies are justified by the fact that the two boundaries are likely
to be near the first found value (i.e., equal ranges are relatively
small). Completes the entire search in $(BIGOH log(n)) time. See also
@@ -7029,9 +7029,9 @@ assert(equal(p, [4, 4, 5, 6]));
// trisect
/**
-Returns a tuple $(D r) such that $(D r[0]) is the same as the result
-of $(D lowerBound(value)), $(D r[1]) is the same as the result of $(D
-equalRange(value)), and $(D r[2]) is the same as the result of $(D
+Returns a tuple `r` such that `r[0]` is the same as the result
+of `lowerBound(value)`, `r[1]` is the same as the result of $(D
+equalRange(value)), and `r[2]` is the same as the result of $(D
upperBound(value)). The call is faster than computing all three
separately. Uses a search schedule similar to $(D
equalRange). Completes the entire search in $(BIGOH log(n)) time.
@@ -7089,9 +7089,9 @@ assert(equal(r[2], [ 4, 4, 5, 6 ]));
// contains
/**
-Returns $(D true) if and only if $(D value) can be found in $(D
+Returns `true` if and only if `value` can be found in $(D
range), which is assumed to be sorted. Performs $(BIGOH log(r.length))
-evaluations of $(D pred). See also STL's $(WEB
+evaluations of `pred`. See also STL's $(WEB
sgi.com/tech/stl/binary_search.html, binary_search).
*/
@@ -7138,13 +7138,13 @@ unittest
}
/**
-$(D SortedRange) could accept ranges weaker than random-access, but it
+`SortedRange` could accept ranges weaker than random-access, but it
is unable to provide interesting functionality for them. Therefore,
-$(D SortedRange) is currently restricted to random-access ranges.
+`SortedRange` is currently restricted to random-access ranges.
No copy of the original range is ever made. If the underlying range is
-changed concurrently with its corresponding $(D SortedRange) in ways
-that break its sortedness, $(D SortedRange) will work erratically.
+changed concurrently with its corresponding `SortedRange` in ways
+that break its sortedness, `SortedRange` will work erratically.
*/
@safe unittest
{
@@ -7269,11 +7269,11 @@ unittest
}
/**
-Assumes $(D r) is sorted by predicate $(D pred) and returns the
-corresponding $(D SortedRange!(pred, R)) having $(D r) as support. To
+Assumes `r` is sorted by predicate `pred` and returns the
+corresponding $(D SortedRange!(pred, R)) having `r` as support. To
keep the checking costs low, the cost is $(BIGOH 1) in release mode
(no checks for sortedness are performed). In debug mode, a few random
-elements of $(D r) are checked for sortedness. The size of the sample
+elements of `r` are checked for sortedness. The size of the sample
is proportional $(BIGOH log(r.length)). That way, checking has no
effect on the complexity of subsequent operations specific to sorted
ranges (such as binary search). The probability of an arbitrary
@@ -7376,8 +7376,8 @@ unittest
if it were passed to it, the original range is $(I not) copied but is
consumed as if it were a reference type.
- Note that $(D save) works as normal and operates on a new range, so if
- $(D save) is ever called on the RefRange, then no operations on the saved
+ Note that `save` works as normal and operates on a new range, so if
+ `save` is ever called on the RefRange, then no operations on the saved
range will affect the original.
Examples:
@@ -7419,13 +7419,13 @@ public:
/++
- This does not assign the pointer of $(D rhs) to this $(D RefRange).
- Rather it assigns the range pointed to by $(D rhs) to the range pointed
- to by this $(D RefRange). This is because $(I any) operation on a
- $(D RefRange) is the same is if it occurred to the original range. The
- one exception is when a $(D RefRange) is assigned $(D null) either
- directly or because $(D rhs) is $(D null). In that case, $(D RefRange)
- no longer refers to the original range but is $(D null).
+ This does not assign the pointer of `rhs` to this `RefRange`.
+ Rather it assigns the range pointed to by `rhs` to the range pointed
+ to by this `RefRange`. This is because $(I any) operation on a
+ `RefRange` is the same is if it occurred to the original range. The
+ one exception is when a `RefRange` is assigned `null` either
+ directly or because `rhs` is `null`. In that case, `RefRange`
+ no longer refers to the original range but is `null`.
Examples:
--------------------
@@ -7619,7 +7619,7 @@ assert(buffer2 == [11, 12, 13, 14, 15]);
version(StdDdoc)
{
/++
- Only defined if $(D isBidirectionalRange!R) is $(D true).
+ Only defined if `isBidirectionalRange!R` is `true`.
+/
@property auto back() {assert(0);}
/++ Ditto +/
@@ -7656,7 +7656,7 @@ assert(buffer2 == [11, 12, 13, 14, 15]);
version(StdDdoc)
{
/++
- Only defined if $(D isRandomAccesRange!R) is $(D true).
+ Only defined if `isRandomAccesRange!R` is `true`.
+/
auto ref opIndex(IndexType)(IndexType index) {assert(0);}
@@ -7680,8 +7680,8 @@ assert(buffer2 == [11, 12, 13, 14, 15]);
/++
- Only defined if $(D hasMobileElements!R) and $(D isForwardRange!R) are
- $(D true).
+ Only defined if `hasMobileElements!R` and `isForwardRange!R` are
+ `true`.
+/
static if(hasMobileElements!R && isForwardRange!R) auto moveFront()
{
@@ -7690,8 +7690,8 @@ assert(buffer2 == [11, 12, 13, 14, 15]);
/++
- Only defined if $(D hasMobileElements!R) and $(D isBidirectionalRange!R)
- are $(D true).
+ Only defined if `hasMobileElements!R` and `isBidirectionalRange!R`
+ are `true`.
+/
static if(hasMobileElements!R && isBidirectionalRange!R) auto moveBack()
{
@@ -7700,8 +7700,8 @@ assert(buffer2 == [11, 12, 13, 14, 15]);
/++
- Only defined if $(D hasMobileElements!R) and $(D isRandomAccessRange!R)
- are $(D true).
+ Only defined if `hasMobileElements!R` and `isRandomAccessRange!R`
+ are `true`.
+/
static if(hasMobileElements!R && isRandomAccessRange!R) auto moveAt(IndexType)(IndexType index)
if(is(typeof((*_range).moveAt(index))))
@@ -7713,7 +7713,7 @@ assert(buffer2 == [11, 12, 13, 14, 15]);
version(StdDdoc)
{
/++
- Only defined if $(D hasLength!R) is $(D true).
+ Only defined if `hasLength!R` is `true`.
+/
@property auto length() {assert(0);}
@@ -7737,7 +7737,7 @@ assert(buffer2 == [11, 12, 13, 14, 15]);
version(StdDdoc)
{
/++
- Only defined if $(D hasSlicing!R) is $(D true).
+ Only defined if `hasSlicing!R` is `true`.
+/
auto opSlice(IndexType1, IndexType2)
(IndexType1 begin, IndexType2 end) {assert(0);}
@@ -8205,11 +8205,11 @@ struct NullSink
of the range can be passed to a provided function or $(LREF OutputRange)
as they are iterated over. This is useful for printing out intermediate
values in a long chain of range code, performing some operation with
- side-effects on each call to $(D front) or $(D popFront), or diverting
+ side-effects on each call to `front` or `popFront`, or diverting
the elements of a range into an auxiliary $(LREF OutputRange).
It is important to note that as the resultant range is evaluated lazily,
- in the case of the version of $(D tee) that takes a function, the function
+ in the case of the version of `tee` that takes a function, the function
will not actually be executed until the range is "walked" using functions
that evaluate ranges, such as $(XREF array,array) or
$(XREF algorithm,reduce).
@@ -8288,7 +8288,7 @@ if (is(typeof(fun) == void) || isSomeFunction!fun)
when using either as an $(LREF OutputRange). Since a template
has no type, typeof(template) will always return void.
If it's a template lambda, it's first necessary to instantiate
- it with $(D ElementType!R1).
+ it with `ElementType!R1`.
*/
static if (is(typeof(fun) == void))
alias _fun = fun!(ElementType!R1);
diff --git a/std/range/primitives.d b/std/range/primitives.d
index af5df0f5177..fd095a4a442 100644
--- a/std/range/primitives.d
+++ b/std/range/primitives.d
@@ -8,7 +8,7 @@ $(BOOKTABLE ,
$(TR $(TD $(D $(LREF isInputRange)))
$(TD Tests if something is an $(I input _range), defined to be
something from which one can sequentially read data using the
- primitives $(D front), $(D popFront), and $(D empty).
+ primitives `front`, `popFront`, and `empty`.
))
$(TR $(TD $(D $(LREF isOutputRange)))
$(TD Tests if something is an $(I output _range), defined to be
@@ -18,18 +18,18 @@ $(BOOKTABLE ,
$(TR $(TD $(D $(LREF isForwardRange)))
$(TD Tests if something is a $(I forward _range), defined to be an
input _range with the additional capability that one can save one's
- current position with the $(D save) primitive, thus allowing one to
+ current position with the `save` primitive, thus allowing one to
iterate over the same _range multiple times.
))
$(TR $(TD $(D $(LREF isBidirectionalRange)))
$(TD Tests if something is a $(I bidirectional _range), that is, a
forward _range that allows reverse traversal using the primitives $(D
- back) and $(D popBack).
+ back) and `popBack`.
))
$(TR $(TD $(D $(LREF isRandomAccessRange)))
$(TD Tests if something is a $(I random access _range), which is a
bidirectional _range that also supports the array subscripting
- operation via the primitive $(D opIndex).
+ operation via the primitive `opIndex`.
))
)
@@ -38,7 +38,7 @@ It also provides number of templates that test for various _range capabilities:
$(BOOKTABLE ,
$(TR $(TD $(D $(LREF hasMobileElements)))
$(TD Tests if a given _range's elements can be moved around using the
- primitives $(D moveFront), $(D moveBack), or $(D moveAt).
+ primitives `moveFront`, `moveBack`, or `moveAt`.
))
$(TR $(TD $(D $(LREF ElementType)))
$(TD Returns the element type of a given _range.
@@ -57,7 +57,7 @@ $(BOOKTABLE ,
passed by reference and have their address taken.
))
$(TR $(TD $(D $(LREF hasLength)))
- $(TD Tests if a given _range has the $(D length) attribute.
+ $(TD Tests if a given _range has the `length` attribute.
))
$(TR $(TD $(D $(LREF isInfinite)))
$(TD Tests if a given _range is an $(I infinite _range).
@@ -118,8 +118,8 @@ module std.range.primitives;
import std.traits;
/**
-Returns $(D true) if $(D R) is an input range. An input range must
-define the primitives $(D empty), $(D popFront), and $(D front). The
+Returns `true` if `R` is an input range. An input range must
+define the primitives `empty`, `popFront`, and `front`. The
following code should compile for any input range.
----
@@ -130,15 +130,15 @@ auto h = r.front; // can get the front of the range of non-void type
----
The semantics of an input range (not checkable during compilation) are
-assumed to be the following ($(D r) is an object of type $(D R)):
+assumed to be the following (`r` is an object of type `R`):
-$(UL $(LI $(D r.empty) returns $(D false) iff there is more data
-available in the range.) $(LI $(D r.front) returns the current
+$(UL $(LI `r.empty` returns `false` iff there is more data
+available in the range.) $(LI `r.front` returns the current
element in the range. It may return by value or by reference. Calling
-$(D r.front) is allowed only if calling $(D r.empty) has, or would
-have, returned $(D false).) $(LI $(D r.popFront) advances to the next
-element in the range. Calling $(D r.popFront) is allowed only if
-calling $(D r.empty) has, or would have, returned $(D false).))
+`r.front` is allowed only if calling `r.empty` has, or would
+have, returned `false`.) $(LI `r.popFront` advances to the next
+element in the range. Calling `r.popFront` is allowed only if
+calling `r.empty` has, or would have, returned `false`.))
*/
template isInputRange(R)
{
@@ -170,13 +170,13 @@ template isInputRange(R)
}
/+
-puts the whole raw element $(D e) into $(D r). doPut will not attempt to
-iterate, slice or transcode $(D e) in any way shape or form. It will $(B only)
-call the correct primitive ($(D r.put(e)), $(D r.front = e) or
-$(D r(0)) once.
+puts the whole raw element `e` into `r`. doPut will not attempt to
+iterate, slice or transcode `e` in any way shape or form. It will $(B only)
+call the correct primitive (`r.put(e)`, $(D r.front = e) or
+`r(0)` once.
-This can be important when $(D e) needs to be placed in $(D r) unchanged.
-Furthermore, it can be useful when working with $(D InputRange)s, as doPut
+This can be important when `e` needs to be placed in `r` unchanged.
+Furthermore, it can be useful when working with `InputRange`s, as doPut
guarantees that no more than a single element will be placed.
+/
private void doPut(R, E)(ref R r, auto ref E e)
@@ -236,14 +236,14 @@ private void doPut(R, E)(ref R r, auto ref E e)
}
/++
-Outputs $(D e) to $(D r). The exact effect is dependent upon the two
+Outputs `e` to `r`. The exact effect is dependent upon the two
types. Several cases are accepted, as described below. The code snippets
are attempted in order, and the first to compile "wins" and gets
evaluated.
-In this table "doPut" is a method that places $(D e) into $(D r), using the
-correct primitive: $(D r.put(e)) if $(D R) defines $(D put), $(D r.front = e)
-if $(D r) is an input range (followed by $(D r.popFront())), or $(D r(e))
+In this table "doPut" is a method that places `e` into `r`, using the
+correct primitive: `r.put(e)` if `R` defines `put`, $(D r.front = e)
+if `r` is an input range (followed by `r.popFront()`), or `r(e)`
otherwise.
$(BOOKTABLE ,
@@ -252,27 +252,27 @@ $(BOOKTABLE ,
$(TH Scenario)
)
$(TR
- $(TD $(D r.doPut(e);))
- $(TD $(D R) specifically accepts an $(D E).)
+ $(TD `r.doPut(e);`)
+ $(TD `R` specifically accepts an `E`.)
)
$(TR
$(TD $(D r.doPut([ e ]);))
- $(TD $(D R) specifically accepts an $(D E[]).)
+ $(TD `R` specifically accepts an `E[]`.)
)
$(TR
- $(TD $(D r.putChar(e);))
- $(TD $(D R) accepts some form of string or character. put will
- transcode the character $(D e) accordingly.)
+ $(TD `r.putChar(e);`)
+ $(TD `R` accepts some form of string or character. put will
+ transcode the character `e` accordingly.)
)
$(TR
$(TD $(D for (; !e.empty; e.popFront()) put(r, e.front);))
- $(TD Copying range $(D E) into $(D R).)
+ $(TD Copying range `E` into `R`.)
)
)
-Tip: $(D put) should $(I not) be used "UFCS-style", e.g. $(D r.put(e)).
-Doing this may call $(D R.put) directly, by-passing any transformation
-feature provided by $(D Range.put). $(D put(r, e)) is prefered.
+Tip: `put` should $(I not) be used "UFCS-style", e.g. `r.put(e)`.
+Doing this may call `R.put` directly, by-passing any transformation
+feature provided by `Range.put`. $(D put(r, e)) is prefered.
+/
void put(R, E)(ref R r, E e)
{
@@ -637,15 +637,15 @@ unittest
}
/+
-Returns $(D true) if $(D R) is a native output range for elements of type
-$(D E). An output range is defined functionally as a range that
+Returns `true` if `R` is a native output range for elements of type
+`E`. An output range is defined functionally as a range that
supports the operation $(D doPut(r, e)) as defined above. if $(D doPut(r, e))
-is valid, then $(D put(r,e)) will have the same behavior.
+is valid, then `put(r,e)` will have the same behavior.
-The two guarantees isNativeOutputRange gives over the larger $(D isOutputRange)
+The two guarantees isNativeOutputRange gives over the larger `isOutputRange`
are:
-1: $(D e) is $(B exactly) what will be placed (not $(D [e]), for example).
-2: if $(D E) is a non $(empty) $(D InputRange), then placing $(D e) is
+1: `e` is $(B exactly) what will be placed (not `[e]`, for example).
+2: if `E` is a non $(empty) `InputRange`, then placing `e` is
guaranteed to not overflow the range.
+/
package template isNativeOutputRange(R, E)
@@ -673,8 +673,8 @@ package template isNativeOutputRange(R, E)
put(r, [1, 2]); //May actually error out.
}
/++
-Returns $(D true) if $(D R) is an output range for elements of type
-$(D E). An output range is defined functionally as a range that
+Returns `true` if `R` is an output range for elements of type
+`E`. An output range is defined functionally as a range that
supports the operation $(D put(r, e)) as defined above.
+/
template isOutputRange(R, E)
@@ -721,9 +721,9 @@ template isOutputRange(R, E)
/**
-Returns $(D true) if $(D R) is a forward range. A forward range is an
-input range $(D r) that can save "checkpoints" by saving $(D r.save)
-to another value of type $(D R). Notable examples of input ranges that
+Returns `true` if `R` is a forward range. A forward range is an
+input range `r` that can save "checkpoints" by saving `r.save`
+to another value of type `R`. Notable examples of input ranges that
are $(I not) forward ranges are file/socket ranges; copying such a
range will not save the position in the stream, and they most likely
reuse an internal buffer as the entire stream does not sit in
@@ -738,14 +738,14 @@ R r1;
static assert (is(typeof(r1.save) == R));
----
-Saving a range is not duplicating it; in the example above, $(D r1)
-and $(D r2) still refer to the same underlying data. They just
+Saving a range is not duplicating it; in the example above, `r1`
+and `r2` still refer to the same underlying data. They just
navigate that data independently.
The semantics of a forward range (not checkable during compilation)
are the same as for an input range, with the additional requirement
that backtracking must be possible by saving a copy of the range
-object with $(D save) and using it later.
+object with `save` and using it later.
*/
template isForwardRange(R)
{
@@ -765,9 +765,9 @@ template isForwardRange(R)
}
/**
-Returns $(D true) if $(D R) is a bidirectional range. A bidirectional
-range is a forward range that also offers the primitives $(D back) and
-$(D popBack). The following code should compile for any bidirectional
+Returns `true` if `R` is a bidirectional range. A bidirectional
+range is a forward range that also offers the primitives `back` and
+`popBack`. The following code should compile for any bidirectional
range.
----
@@ -780,12 +780,12 @@ static assert(is(typeof(t) == typeof(w))); // same type for front and back
----
The semantics of a bidirectional range (not checkable during
-compilation) are assumed to be the following ($(D r) is an object of
-type $(D R)):
+compilation) are assumed to be the following (`r` is an object of
+type `R`):
-$(UL $(LI $(D r.back) returns (possibly a reference to) the last
-element in the range. Calling $(D r.back) is allowed only if calling
-$(D r.empty) has, or would have, returned $(D false).))
+$(UL $(LI `r.back` returns (possibly a reference to) the last
+element in the range. Calling `r.back` is allowed only if calling
+`r.empty` has, or would have, returned `false`.))
*/
template isBidirectionalRange(R)
{
@@ -827,10 +827,10 @@ template isBidirectionalRange(R)
}
/**
-Returns $(D true) if $(D R) is a random-access range. A random-access
+Returns `true` if `R` is a random-access range. A random-access
range is a bidirectional range that also offers the primitive $(D
-opIndex), OR an infinite forward range that offers $(D opIndex). In
-either case, the range must either offer $(D length) or be
+opIndex), OR an infinite forward range that offers `opIndex`. In
+either case, the range must either offer `length` or be
infinite. The following code should compile for any random-access
range.
@@ -858,13 +858,13 @@ static if(is(typeof(r[$])))
----
The semantics of a random-access range (not checkable during
-compilation) are assumed to be the following ($(D r) is an object of
-type $(D R)): $(UL $(LI $(D r.opIndex(n)) returns a reference to the
-$(D n)th element in the range.))
+compilation) are assumed to be the following (`r` is an object of
+type `R`): $(UL $(LI `r.opIndex(n)` returns a reference to the
+`n`th element in the range.))
-Although $(D char[]) and $(D wchar[]) (as well as their qualified
-versions including $(D string) and $(D wstring)) are arrays, $(D
-isRandomAccessRange) yields $(D false) for them because they use
+Although `char[]` and `wchar[]` (as well as their qualified
+versions including `string` and `wstring`) are arrays, $(D
+isRandomAccessRange) yields `false` for them because they use
variable-length encodings (UTF-8 and UTF-16 respectively). These types
are bidirectional ranges only.
*/
@@ -959,10 +959,10 @@ template isRandomAccessRange(R)
}
/**
-Returns $(D true) iff $(D R) is an input range that supports the
-$(D moveFront) primitive, as well as $(D moveBack) and $(D moveAt) if it's a
+Returns `true` iff `R` is an input range that supports the
+`moveFront` primitive, as well as `moveBack` and `moveAt` if it's a
bidirectional or random access range. These may be explicitly implemented, or
-may work via the default behavior of the module level functions $(D moveFront)
+may work via the default behavior of the module level functions `moveFront`
and friends. The following code should compile for any range
with mobile elements.
@@ -1016,12 +1016,12 @@ template hasMobileElements(R)
}
/**
-The element type of $(D R). $(D R) does not have to be a range. The
-element type is determined as the type yielded by $(D r.front) for an
-object $(D r) of type $(D R). For example, $(D ElementType!(T[])) is
-$(D T) if $(D T[]) isn't a narrow string; if it is, the element type is
-$(D dchar). If $(D R) doesn't have $(D front), $(D ElementType!R) is
-$(D void).
+The element type of `R`. `R` does not have to be a range. The
+element type is determined as the type yielded by `r.front` for an
+object `r` of type `R`. For example, `ElementType!(T[])` is
+`T` if `T[]` isn't a narrow string; if it is, the element type is
+`dchar`. If `R` doesn't have `front`, `ElementType!R` is
+`void`.
*/
template ElementType(R)
{
@@ -1103,11 +1103,11 @@ template ElementType(R)
}
/**
-The encoding element type of $(D R). For narrow strings ($(D char[]),
-$(D wchar[]) and their qualified variants including $(D string) and
-$(D wstring)), $(D ElementEncodingType) is the character type of the
-string. For all other types, $(D ElementEncodingType) is the same as
-$(D ElementType).
+The encoding element type of `R`. For narrow strings (`char[]`,
+`wchar[]` and their qualified variants including `string` and
+`wstring`), `ElementEncodingType` is the character type of the
+string. For all other types, `ElementEncodingType` is the same as
+`ElementType`.
*/
template ElementEncodingType(R)
{
@@ -1168,7 +1168,7 @@ template ElementEncodingType(R)
}
/**
-Returns $(D true) if $(D R) is an input range and has swappable
+Returns `true` if `R` is an input range and has swappable
elements. The following code should compile for any range
with swappable elements.
@@ -1208,7 +1208,7 @@ template hasSwappableElements(R)
}
/**
-Returns $(D true) if $(D R) is an input range and has mutable
+Returns `true` if `R` is an input range and has mutable
elements. The following code should compile for any range
with assignable elements.
@@ -1247,7 +1247,7 @@ template hasAssignableElements(R)
}
/**
-Tests whether the range $(D R) has lvalue elements. These are defined as
+Tests whether the range `R` has lvalue elements. These are defined as
elements that can be passed by reference and have their address taken.
The following code should compile for any range with lvalue elements.
----
@@ -1302,16 +1302,16 @@ template hasLvalueElements(R)
}
/**
-Returns $(D true) if $(D R) has a $(D length) member that returns an
-integral type. $(D R) does not have to be a range. Note that $(D
+Returns `true` if `R` has a `length` member that returns an
+integral type. `R` does not have to be a range. Note that $(D
length) is an optional primitive as no range must implement it. Some
ranges do not store their length explicitly, some cannot compute it
without actually exhausting the range (e.g. socket streams), and some
other ranges may be infinite.
-Although narrow string types ($(D char[]), $(D wchar[]), and their
-qualified derivatives) do define a $(D length) property, $(D
-hasLength) yields $(D false) for them. This is because a narrow
+Although narrow string types (`char[]`, `wchar[]`, and their
+qualified derivatives) do define a `length` property, $(D
+hasLength) yields `false` for them. This is because a narrow
string's length does not reflect the number of characters, but instead
the number of encoding units, and as such is not useful with
range-oriented algorithms.
@@ -1342,9 +1342,9 @@ template hasLength(R)
}
/**
-Returns $(D true) if $(D R) is an infinite input range. An
+Returns `true` if `R` is an infinite input range. An
infinite input range is an input range that has a statically-defined
-enumerated member called $(D empty) that is always $(D false),
+enumerated member called `empty` that is always `false`,
for example:
----
@@ -1373,20 +1373,20 @@ template isInfinite(R)
}
/**
-Returns $(D true) if $(D R) offers a slicing operator with integral boundaries
+Returns `true` if `R` offers a slicing operator with integral boundaries
that returns a forward range type.
-For finite ranges, the result of $(D opSlice) must be of the same type as the
-original range type. If the range defines $(D opDollar), then it must support
+For finite ranges, the result of `opSlice` must be of the same type as the
+original range type. If the range defines `opDollar`, then it must support
subtraction.
-For infinite ranges, when $(I not) using $(D opDollar), the result of
-$(D opSlice) must be the result of $(LREF take) or $(LREF takeExactly) on the
+For infinite ranges, when $(I not) using `opDollar`, the result of
+`opSlice` must be the result of $(LREF take) or $(LREF takeExactly) on the
original range (they both return the same type for infinite ranges). However,
-when using $(D opDollar), the result of $(D opSlice) must be that of the
+when using `opDollar`, the result of `opSlice` must be that of the
original range type.
-The following code must compile for $(D hasSlicing) to be $(D true):
+The following code must compile for `hasSlicing` to be `true`:
----
R r = void;
@@ -1503,23 +1503,23 @@ template hasSlicing(R)
}
/**
-This is a best-effort implementation of $(D length) for any kind of
+This is a best-effort implementation of `length` for any kind of
range.
-If $(D hasLength!Range), simply returns $(D range.length) without
-checking $(D upTo) (when specified).
+If `hasLength!Range`, simply returns `range.length` without
+checking `upTo` (when specified).
Otherwise, walks the range through its length and returns the number
-of elements seen. Performes $(BIGOH n) evaluations of $(D range.empty)
-and $(D range.popFront()), where $(D n) is the effective length of $(D
+of elements seen. Performes $(BIGOH n) evaluations of `range.empty`
+and `range.popFront()`, where `n` is the effective length of $(D
range).
-The $(D upTo) parameter is useful to "cut the losses" in case
+The `upTo` parameter is useful to "cut the losses" in case
the interest is in seeing whether the range has at least some number
-of elements. If the parameter $(D upTo) is specified, stops if $(D
-upTo) steps have been taken and returns $(D upTo).
+of elements. If the parameter `upTo` is specified, stops if $(D
+upTo) steps have been taken and returns `upTo`.
-Infinite ranges are compatible, provided the parameter $(D upTo) is
+Infinite ranges are compatible, provided the parameter `upTo` is
specified, in which case the implementation simply returns upTo.
*/
auto walkLength(Range)(Range range)
@@ -1580,17 +1580,17 @@ auto walkLength(Range)(Range range, const size_t upTo)
}
/**
- Eagerly advances $(D r) itself (not a copy) up to $(D n) times (by
- calling $(D r.popFront)). $(D popFrontN) takes $(D r) by $(D ref),
+ Eagerly advances `r` itself (not a copy) up to `n` times (by
+ calling `r.popFront`). `popFrontN` takes `r` by `ref`,
so it mutates the original range. Completes in $(BIGOH 1) steps for ranges
that support slicing and have length.
Completes in $(BIGOH n) time for all other ranges.
Returns:
- How much $(D r) was actually advanced, which may be less than $(D n) if
- $(D r) did not have at least $(D n) elements.
+ How much `r` was actually advanced, which may be less than `n` if
+ `r` did not have at least `n` elements.
- $(D popBackN) will behave the same but instead removes elements from
+ `popBackN` will behave the same but instead removes elements from
the back of the (bidirectional) range instead of the front.
*/
size_t popFrontN(Range)(ref Range r, size_t n)
@@ -1707,21 +1707,21 @@ size_t popBackN(Range)(ref Range r, size_t n)
}
/**
- Eagerly advances $(D r) itself (not a copy) exactly $(D n) times (by
- calling $(D r.popFront)). $(D popFrontExactly) takes $(D r) by $(D ref),
+ Eagerly advances `r` itself (not a copy) exactly `n` times (by
+ calling `r.popFront`). `popFrontExactly` takes `r` by `ref`,
so it mutates the original range. Completes in $(BIGOH 1) steps for ranges
that support slicing, and have either length or are infinite.
Completes in $(BIGOH n) time for all other ranges.
- Note: Unlike $(LREF popFrontN), $(D popFrontExactly) will assume that the
- range holds at least $(D n) elements. This makes $(D popFrontExactly)
- faster than $(D popFrontN), but it also means that if $(D range) does
- not contain at least $(D n) elements, it will attempt to call $(D popFront)
+ Note: Unlike $(LREF popFrontN), `popFrontExactly` will assume that the
+ range holds at least `n` elements. This makes `popFrontExactly`
+ faster than `popFrontN`, but it also means that if `range` does
+ not contain at least `n` elements, it will attempt to call `popFront`
on an empty range, which is undefined behavior. So, only use
- $(D popFrontExactly) when it is guaranteed that $(D range) holds at least
- $(D n) elements.
+ `popFrontExactly` when it is guaranteed that `range` holds at least
+ `n` elements.
- $(D popBackExactly) will behave the same but instead removes elements from
+ `popBackExactly` will behave the same but instead removes elements from
the back of the (bidirectional) range instead of the front.
*/
void popFrontExactly(Range)(ref Range r, size_t n)
@@ -1780,9 +1780,9 @@ void popBackExactly(Range)(ref Range r, size_t n)
}
/**
- Moves the front of $(D r) out and returns it. Leaves $(D r.front) in a
+ Moves the front of `r` out and returns it. Leaves `r.front` in a
destroyable state that does not allocate any resources (usually equal
- to its $(D .init) value).
+ to its `.init` value).
*/
ElementType!R moveFront(R)(R r)
{
@@ -1829,9 +1829,9 @@ ElementType!R moveFront(R)(R r)
}
/**
- Moves the back of $(D r) out and returns it. Leaves $(D r.back) in a
+ Moves the back of `r` out and returns it. Leaves `r.back` in a
destroyable state that does not allocate any resources (usually equal
- to its $(D .init) value).
+ to its `.init` value).
*/
ElementType!R moveBack(R)(R r)
{
@@ -1868,9 +1868,9 @@ ElementType!R moveBack(R)(R r)
}
/**
- Moves element at index $(D i) of $(D r) out and returns it. Leaves $(D
+ Moves element at index `i` of `r` out and returns it. Leaves $(D
r.front) in a destroyable state that does not allocate any resources
- (usually equal to its $(D .init) value).
+ (usually equal to its `.init` value).
*/
ElementType!R moveAt(R, I)(R r, I i) if (isIntegral!I)
{
@@ -1916,10 +1916,10 @@ ElementType!R moveAt(R, I)(R r, I i) if (isIntegral!I)
}
/**
-Implements the range interface primitive $(D empty) for built-in
+Implements the range interface primitive `empty` for built-in
arrays. Due to the fact that nonmember functions can be called with
-the first argument using the dot notation, $(D array.empty) is
-equivalent to $(D empty(array)).
+the first argument using the dot notation, `array.empty` is
+equivalent to `empty(array)`.
*/
@property bool empty(T)(in T[] a) @safe pure nothrow
@@ -1936,10 +1936,10 @@ equivalent to $(D empty(array)).
}
/**
-Implements the range interface primitive $(D save) for built-in
+Implements the range interface primitive `save` for built-in
arrays. Due to the fact that nonmember functions can be called with
-the first argument using the dot notation, $(D array.save) is
-equivalent to $(D save(array)). The function does not duplicate the
+the first argument using the dot notation, `array.save` is
+equivalent to `save(array)`. The function does not duplicate the
content of the array, it simply returns its argument.
*/
@@ -1956,11 +1956,11 @@ content of the array, it simply returns its argument.
assert(b is a);
}
/**
-Implements the range interface primitive $(D popFront) for built-in
+Implements the range interface primitive `popFront` for built-in
arrays. Due to the fact that nonmember functions can be called with
-the first argument using the dot notation, $(D array.popFront) is
-equivalent to $(D popFront(array)). For $(GLOSSARY narrow strings),
-$(D popFront) automatically advances to the next $(GLOSSARY code
+the first argument using the dot notation, `array.popFront` is
+equivalent to `popFront(array)`. For $(GLOSSARY narrow strings),
+`popFront` automatically advances to the next $(GLOSSARY code
point).
*/
@@ -2056,10 +2056,10 @@ if (isNarrowString!(C[]))
}
/**
-Implements the range interface primitive $(D popBack) for built-in
+Implements the range interface primitive `popBack` for built-in
arrays. Due to the fact that nonmember functions can be called with
-the first argument using the dot notation, $(D array.popBack) is
-equivalent to $(D popBack(array)). For $(GLOSSARY narrow strings), $(D
+the first argument using the dot notation, `array.popBack` is
+equivalent to `popBack(array)`. For $(GLOSSARY narrow strings), $(D
popFront) automatically eliminates the last $(GLOSSARY code point).
*/
@@ -2122,10 +2122,10 @@ if (isNarrowString!(T[]))
}
/**
-Implements the range interface primitive $(D front) for built-in
+Implements the range interface primitive `front` for built-in
arrays. Due to the fact that nonmember functions can be called with
-the first argument using the dot notation, $(D array.front) is
-equivalent to $(D front(array)). For $(GLOSSARY narrow strings), $(D
+the first argument using the dot notation, `array.front` is
+equivalent to `front(array)`. For $(GLOSSARY narrow strings), $(D
front) automatically returns the first $(GLOSSARY code point) as a $(D
dchar).
*/
@@ -2166,10 +2166,10 @@ if (!isNarrowString!(T[]) && !is(T[] == void[]))
}
/**
-Implements the range interface primitive $(D back) for built-in
+Implements the range interface primitive `back` for built-in
arrays. Due to the fact that nonmember functions can be called with
-the first argument using the dot notation, $(D array.back) is
-equivalent to $(D back(array)). For $(GLOSSARY narrow strings), $(D
+the first argument using the dot notation, `array.back` is
+equivalent to `back(array)`. For $(GLOSSARY narrow strings), $(D
back) automatically returns the last $(GLOSSARY code point) as a $(D
dchar).
*/
diff --git a/std/regex/internal/ir.d b/std/regex/internal/ir.d
index f2172bd77b3..7b935cd04cd 100644
--- a/std/regex/internal/ir.d
+++ b/std/regex/internal/ir.d
@@ -430,8 +430,8 @@ struct Group(DataIndex)
}
/++
- $(D Regex) object holds regular expression pattern in compiled form.
- Instances of this object are constructed via calls to $(D regex).
+ `Regex` object holds regular expression pattern in compiled form.
+ Instances of this object are constructed via calls to `regex`.
This is an intended form for caching and storage of frequently
used regular expressions.
+/
diff --git a/std/regex/package.d b/std/regex/package.d
index f421919cda2..5abd95e9fbb 100644
--- a/std/regex/package.d
+++ b/std/regex/package.d
@@ -33,7 +33,7 @@
...
- // The result of the $(D matchAll) is directly testable with if/assert/while.
+ // The result of the `matchAll` is directly testable with if/assert/while.
// e.g. test if a string consists of letters:
assert(matchFirst("Letter", `^\p{L}+$`));
@@ -47,7 +47,7 @@
Checks of this sort of are better addressed by additional post-processing.
The basic syntax shouldn't surprise experienced users of regular expressions.
- For an introduction to $(D std.regex) see a
+ For an introduction to `std.regex` see a
$(WEB dlang.org/regular-expression.html, short tour) of the module API
and its abilities.
@@ -203,7 +203,7 @@
A set of functions in this module that do the substitution rely
on a simple format to guide the process. In particular the table below
- applies to the $(D format) argument of
+ applies to the `format` argument of
$(LREF replaceFirst) and $(LREF replaceAll).
The format string can reference parts of match using the following notation.
@@ -221,7 +221,7 @@
$(SECTION Slicing and zero memory allocations orientation)
All matches returned by pattern matching functionality in this library
- are slices of the original input. The notable exception is the $(D replace)
+ are slices of the original input. The notable exception is the `replace`
family of functions that generate a new string from the input.
In cases where producing the replacement is the ultimate goal
@@ -234,7 +234,7 @@
Authors: Dmitry Olshansky,
- API and utility constructs are modeled after the original $(D std.regex)
+ API and utility constructs are modeled after the original `std.regex`
by Walter Bright and Andrei Alexandrescu.
Source: $(PHOBOSSRC std/_regex.d)
@@ -254,9 +254,9 @@ import std.regex.internal.thompson; //TODO: get rid of this dependency
import std.exception, std.traits, std.range;
/++
- $(D Regex) object holds regular expression pattern in compiled form.
+ `Regex` object holds regular expression pattern in compiled form.
- Instances of this object are constructed via calls to $(D regex).
+ Instances of this object are constructed via calls to `regex`.
This is an intended form for caching and storage of frequently
used regular expressions.
@@ -288,24 +288,24 @@ import std.exception, std.traits, std.range;
public alias Regex(Char) = std.regex.internal.ir.Regex!(Char);
/++
- A $(D StaticRegex) is $(D Regex) object that contains D code specially
+ A `StaticRegex` is `Regex` object that contains D code specially
generated at compile-time to speed up matching.
- Implicitly convertible to normal $(D Regex),
+ Implicitly convertible to normal `Regex`,
however doing so will result in losing this additional capability.
+/
public alias StaticRegex(Char) = std.regex.internal.ir.StaticRegex!(Char);
/++
Compile regular expression pattern for the later execution.
- Returns: $(D Regex) object that works on inputs having
- the same character width as $(D pattern).
+ Returns: `Regex` object that works on inputs having
+ the same character width as `pattern`.
Params:
pattern = Regular expression
flags = The _attributes (g, i, m and x accepted)
- Throws: $(D RegexException) if there were any errors during compilation.
+ Throws: `RegexException` if there were any errors during compilation.
+/
@trusted public auto regex(S)(S pattern, const(char)[] flags="")
if(isSomeString!(S))
@@ -359,8 +359,8 @@ enum isRegexFor(RegEx, R) = is(RegEx == Regex!(BasicElementOf!R))
/++
- $(D Captures) object contains submatches captured during a call
- to $(D match) or iteration over $(D RegexMatch) range.
+ `Captures` object contains submatches captured during a call
+ to `match` or iteration over `RegexMatch` range.
First element of range is the whole match.
+/
@@ -538,13 +538,13 @@ unittest
}
/++
- A regex engine state, as returned by $(D match) family of functions.
+ A regex engine state, as returned by `match` family of functions.
Effectively it's a forward range of Captures!R, produced
by lazily searching for matches in a given input.
$(D alias Engine) specifies an engine type to use during matching,
- and is automatically deduced in a call to $(D match)/$(D bmatch).
+ and is automatically deduced in a call to `match`/`bmatch`.
+/
@trusted public struct RegexMatch(R, alias Engine = ThompsonMatcher)
if(isSomeString!R)
@@ -758,7 +758,7 @@ private R replaceAllWith(alias output,
/++
- Start matching $(D input) to regex pattern $(D re),
+ Start matching `input` to regex pattern `re`,
using Thompson NFA matching scheme.
The use of this function is $(RED discouraged) - use either of
@@ -770,7 +770,7 @@ private R replaceAllWith(alias output,
matching scheme to use depends highly on the pattern kind and
can done automatically on case by case basis.
- Returns: a $(D RegexMatch) object holding engine state after first match.
+ Returns: a `RegexMatch` object holding engine state after first match.
+/
public auto match(R, RegEx)(R input, RegEx re)
@@ -796,11 +796,11 @@ public auto match(R, RegEx)(R input, RegEx re)
}
/++
- Find the first (leftmost) slice of the $(D input) that
- matches the pattern $(D re). This function picks the most suitable
+ Find the first (leftmost) slice of the `input` that
+ matches the pattern `re`. This function picks the most suitable
regular expression engine depending on the pattern properties.
- $(D re) parameter can be one of three types:
+ `re` parameter can be one of three types:
$(UL
$(LI Plain string, in which case it's compiled to bytecode before matching. )
$(LI Regex!char (wchar/dchar) that contains a pattern in the form of
@@ -836,14 +836,14 @@ public auto matchFirst(R, RegEx)(R input, RegEx re)
}
/++
- Initiate a search for all non-overlapping matches to the pattern $(D re)
- in the given $(D input). The result is a lazy range of matches generated
+ Initiate a search for all non-overlapping matches to the pattern `re`
+ in the given `input`. The result is a lazy range of matches generated
as they are encountered in the input going left to right.
This function picks the most suitable regular expression engine
depending on the pattern properties.
- $(D re) parameter can be one of three types:
+ `re` parameter can be one of three types:
$(UL
$(LI Plain string, in which case it's compiled to bytecode before matching. )
$(LI Regex!char (wchar/dchar) that contains a pattern in the form of
@@ -920,7 +920,7 @@ public auto matchAll(R, RegEx)(R input, RegEx re)
}
/++
- Start matching of $(D input) to regex pattern $(D re),
+ Start matching of `input` to regex pattern `re`,
using traditional $(LUCKY backtracking) matching scheme.
The use of this function is $(RED discouraged) - use either of
@@ -932,7 +932,7 @@ public auto matchAll(R, RegEx)(R input, RegEx re)
matching scheme to use depends highly on the pattern kind and
can done automatically on case by case basis.
- Returns: a $(D RegexMatch) object holding engine
+ Returns: a `RegexMatch` object holding engine
state after first match.
+/
@@ -1030,8 +1030,8 @@ L_Replace_Loop:
}
/++
- Construct a new string from $(D input) by replacing the first match with
- a string generated from it according to the $(D format) specifier.
+ Construct a new string from `input` by replacing the first match with
+ a string generated from it according to the `format` specifier.
To replace all matches use $(LREF replaceAll).
@@ -1058,18 +1058,18 @@ public R replaceFirst(R, C, RegEx)(R input, RegEx re, const(C)[] format)
/++
This is a general replacement tool that construct a new string by replacing
- matches of pattern $(D re) in the $(D input). Unlike the other overload
+ matches of pattern `re` in the `input`. Unlike the other overload
there is no format string instead captures are passed to
- to a user-defined functor $(D fun) that returns a new string
+ to a user-defined functor `fun` that returns a new string
to use as replacement.
- This version replaces the first match in $(D input),
+ This version replaces the first match in `input`,
see $(LREF replaceAll) to replace the all of the matches.
Returns:
- A new string of the same type as $(D input) with all matches
- replaced by return values of $(D fun). If no matches found
- returns the $(D input) itself.
+ A new string of the same type as `input` with all matches
+ replaced by return values of `fun`. If no matches found
+ returns the `input` itself.
Example:
---
@@ -1087,11 +1087,11 @@ public R replaceFirst(alias fun, R, RegEx)(R input, RegEx re)
/++
A variation on $(LREF replaceFirst) that instead of allocating a new string
- on each call outputs the result piece-wise to the $(D sink). In particular
+ on each call outputs the result piece-wise to the `sink`. In particular
this enables efficient construction of a final output incrementally.
Like in $(LREF replaceFirst) family of functions there is an overload
- for the substitution guided by the $(D format) string
+ for the substitution guided by the `format` string
and the one with the user defined callback.
Example:
@@ -1142,9 +1142,9 @@ public @trusted void replaceFirstInto(alias fun, Sink, R, RegEx)
}
/++
- Construct a new string from $(D input) by replacing all of the
- fragments that match a pattern $(D re) with a string generated
- from the match according to the $(D format) specifier.
+ Construct a new string from `input` by replacing all of the
+ fragments that match a pattern `re` with a string generated
+ from the match according to the `format` specifier.
To replace only the first match use $(LREF replaceFirst).
@@ -1155,7 +1155,7 @@ public @trusted void replaceFirstInto(alias fun, Sink, R, RegEx)
see $(S_LINK Replace format string, the format string).
Returns:
- A string of the same type as $(D input) with the all
+ A string of the same type as `input` with the all
of the matches (if any) replaced.
If no match is found returns the input string itself.
@@ -1174,18 +1174,18 @@ public @trusted R replaceAll(R, C, RegEx)(R input, RegEx re, const(C)[] format)
/++
This is a general replacement tool that construct a new string by replacing
- matches of pattern $(D re) in the $(D input). Unlike the other overload
+ matches of pattern `re` in the `input`. Unlike the other overload
there is no format string instead captures are passed to
- to a user-defined functor $(D fun) that returns a new string
+ to a user-defined functor `fun` that returns a new string
to use as replacement.
- This version replaces all of the matches found in $(D input),
+ This version replaces all of the matches found in `input`,
see $(LREF replaceFirst) to replace the first match only.
Returns:
- A new string of the same type as $(D input) with all matches
- replaced by return values of $(D fun). If no matches found
- returns the $(D input) itself.
+ A new string of the same type as `input` with all matches
+ replaced by return values of `fun`. If no matches found
+ returns the `input` itself.
Params:
input = string to search
@@ -1212,7 +1212,7 @@ public @trusted R replaceAll(alias fun, R, RegEx)(R input, RegEx re)
/++
A variation on $(LREF replaceAll) that instead of allocating a new string
- on each call outputs the result piece-wise to the $(D sink). In particular
+ on each call outputs the result piece-wise to the `sink`. In particular
this enables efficient construction of a final output incrementally.
As with $(LREF replaceAll) there are 2 overloads - one with a format string,
@@ -1303,7 +1303,7 @@ public @trusted void replaceAllInto(alias fun, Sink, R, RegEx)
}
/++
- Old API for replacement, operation depends on flags of pattern $(D re).
+ Old API for replacement, operation depends on flags of pattern `re`.
With "g" flag it performs the equivalent of $(LREF replaceAll) otherwise it
works the same as $(LREF replaceFirst).
@@ -1405,7 +1405,7 @@ public:
}
/**
- A helper function, creates a $(D Splitter) on range $(D r) separated by regex $(D pat).
+ A helper function, creates a `Splitter` on range `r` separated by regex `pat`.
Captured subexpressions have no effect on the resulting range.
*/
public Splitter!(Range, RegEx) splitter(Range, RegEx)(Range r, RegEx pat)
@@ -1414,7 +1414,7 @@ public Splitter!(Range, RegEx) splitter(Range, RegEx)(Range r, RegEx pat)
return Splitter!(Range, RegEx)(r, pat);
}
-///An eager version of $(D splitter) that creates an array with splitted slices of $(D input).
+///An eager version of `splitter` that creates an array with splitted slices of `input`.
public @trusted String[] split(String, RegEx)(String input, RegEx rx)
if(isSomeString!String && isRegexFor!(RegEx, String))
{
diff --git a/std/socket.d b/std/socket.d
index f4db5357906..63bbf5dde3b 100644
--- a/std/socket.d
+++ b/std/socket.d
@@ -142,7 +142,7 @@ version(unittest)
}
}
-/// Base exception thrown by $(D std.socket).
+/// Base exception thrown by `std.socket`.
class SocketException: Exception
{
///
@@ -310,7 +310,7 @@ class SocketFeatureException: SocketException
}
-/// Return $(D true) if the last socket operation failed because the socket
+/// Return `true` if the last socket operation failed because the socket
/// was in non-blocking mode and the operation would have blocked.
bool wouldHaveBlocked() nothrow @nogc
{
@@ -438,7 +438,7 @@ else
/**
- * $(D Protocol) is a class for retrieving protocol information.
+ * `Protocol` is a class for retrieving protocol information.
*
* Example:
* ---
@@ -534,7 +534,7 @@ unittest
/**
- * $(D Service) is a class for retrieving service information.
+ * `Service` is a class for retrieving service information.
*
* Example:
* ---
@@ -645,7 +645,7 @@ unittest
/**
- * Class for exceptions thrown from an $(D InternetHost).
+ * Class for exceptions thrown from an `InternetHost`.
*/
class HostException: SocketOSException
{
@@ -669,9 +669,9 @@ class HostException: SocketOSException
}
/**
- * $(D InternetHost) is a class for resolving IPv4 addresses.
+ * `InternetHost` is a class for resolving IPv4 addresses.
*
- * Consider using $(D getAddress), $(D parseAddress) and $(D Address) methods
+ * Consider using `getAddress`, `parseAddress` and `Address` methods
* instead of using this class directly.
*
* Example:
@@ -892,27 +892,27 @@ unittest
}
-/// Holds information about a socket _address retrieved by $(D getAddressInfo).
+/// Holds information about a socket _address retrieved by `getAddressInfo`.
struct AddressInfo
{
AddressFamily family; /// Address _family
SocketType type; /// Socket _type
ProtocolType protocol; /// Protocol
Address address; /// Socket _address
- string canonicalName; /// Canonical name, when $(D AddressInfoFlags.CANONNAME) is used.
+ string canonicalName; /// Canonical name, when `AddressInfoFlags.CANONNAME` is used.
}
// A subset of flags supported on all platforms with getaddrinfo.
-/// Specifies option flags for $(D getAddressInfo).
+/// Specifies option flags for `getAddressInfo`.
enum AddressInfoFlags: int
{
- /// The resulting addresses will be used in a call to $(D Socket.bind).
+ /// The resulting addresses will be used in a call to `Socket.bind`.
PASSIVE = AI_PASSIVE,
- /// The canonical name is returned in $(D canonicalName) member in the first $(D AddressInfo).
+ /// The canonical name is returned in `canonicalName` member in the first `AddressInfo`.
CANONNAME = AI_CANONNAME,
- /// The $(D node) parameter passed to $(D getAddressInfo) must be a numeric string.
+ /// The `node` parameter passed to `getAddressInfo` must be a numeric string.
/// This will suppress any potentially lengthy network host address lookups.
NUMERICHOST = AI_NUMERICHOST,
}
@@ -936,21 +936,21 @@ private string formatGaiError(int err) @trusted
/**
* Provides _protocol-independent translation from host names to socket
* addresses. If advanced functionality is not required, consider using
- * $(D getAddress) for compatibility with older systems.
+ * `getAddress` for compatibility with older systems.
*
- * Returns: Array with one $(D AddressInfo) per socket address.
+ * Returns: Array with one `AddressInfo` per socket address.
*
- * Throws: $(D SocketOSException) on failure, or $(D SocketFeatureException)
+ * Throws: `SocketOSException` on failure, or `SocketFeatureException`
* if this functionality is not available on the current system.
*
* Params:
* node = string containing host name or numeric address
* options = optional additional parameters, identified by type:
- * $(UL $(LI $(D string) - service name or port number)
- * $(LI $(D AddressInfoFlags) - option flags)
- * $(LI $(D AddressFamily) - address family to filter by)
- * $(LI $(D SocketType) - socket type to filter by)
- * $(LI $(D ProtocolType) - protocol to filter by))
+ * $(UL $(LI `string` - service name or port number)
+ * $(LI `AddressInfoFlags` - option flags)
+ * $(LI `AddressFamily` - address family to filter by)
+ * $(LI `SocketType` - socket type to filter by)
+ * $(LI `ProtocolType` - protocol to filter by))
*
* Example:
* ---
@@ -1100,12 +1100,12 @@ private ushort serviceToPort(in char[] service)
/**
* Provides _protocol-independent translation from host names to socket
- * addresses. Uses $(D getAddressInfo) if the current system supports it,
- * and $(D InternetHost) otherwise.
+ * addresses. Uses `getAddressInfo` if the current system supports it,
+ * and `InternetHost` otherwise.
*
- * Returns: Array with one $(D Address) instance per socket address.
+ * Returns: Array with one `Address` instance per socket address.
*
- * Throws: $(D SocketOSException) on failure.
+ * Throws: `SocketOSException` on failure.
*
* Example:
* ---
@@ -1179,13 +1179,13 @@ unittest
/**
* Provides _protocol-independent parsing of network addresses. Does not
- * attempt name resolution. Uses $(D getAddressInfo) with
- * $(D AddressInfoFlags.NUMERICHOST) if the current system supports it, and
- * $(D InternetAddress) otherwise.
+ * attempt name resolution. Uses `getAddressInfo` with
+ * `AddressInfoFlags.NUMERICHOST` if the current system supports it, and
+ * `InternetAddress` otherwise.
*
- * Returns: An $(D Address) instance representing specified address.
+ * Returns: An `Address` instance representing specified address.
*
- * Throws: $(D SocketException) on failure.
+ * Throws: `SocketException` on failure.
*
* Example:
* ---
@@ -1260,7 +1260,7 @@ unittest
/**
- * Class for exceptions thrown from an $(D Address).
+ * Class for exceptions thrown from an `Address`.
*/
class AddressException: SocketOSException
{
@@ -1285,7 +1285,7 @@ class AddressException: SocketOSException
/**
- * $(D Address) is an abstract class for representing a socket addresses.
+ * `Address` is an abstract class for representing a socket addresses.
*
* Example:
* ---
@@ -1310,11 +1310,11 @@ class AddressException: SocketOSException
*/
abstract class Address
{
- /// Returns pointer to underlying $(D sockaddr) structure.
+ /// Returns pointer to underlying `sockaddr` structure.
abstract @property sockaddr* name() pure nothrow @nogc;
abstract @property const(sockaddr)* name() const pure nothrow @nogc; /// ditto
- /// Returns actual size of underlying $(D sockaddr) structure.
+ /// Returns actual size of underlying `sockaddr` structure.
abstract @property socklen_t nameLen() const pure nothrow @nogc;
/// Family of this address.
@@ -1387,7 +1387,7 @@ abstract class Address
/**
* Attempts to retrieve the host address as a human-readable string.
*
- * Throws: $(D AddressException) on failure, or $(D SocketFeatureException)
+ * Throws: `AddressException` on failure, or `SocketFeatureException`
* if address retrieval for this address family is not available on the
* current system.
*/
@@ -1399,10 +1399,10 @@ abstract class Address
/**
* Attempts to retrieve the host name as a fully qualified domain name.
*
- * Returns: The FQDN corresponding to this $(D Address), or $(D null) if
+ * Returns: The FQDN corresponding to this `Address`, or `null` if
* the host name did not resolve.
*
- * Throws: $(D AddressException) on error, or $(D SocketFeatureException)
+ * Throws: `AddressException` on error, or `SocketFeatureException`
* if host name lookup for this address family is not available on the
* current system.
*/
@@ -1414,7 +1414,7 @@ abstract class Address
/**
* Attempts to retrieve the numeric port number as a string.
*
- * Throws: $(D AddressException) on failure, or $(D SocketFeatureException)
+ * Throws: `AddressException` on failure, or `SocketFeatureException`
* if port number retrieval for this address family is not available on the
* current system.
*/
@@ -1426,7 +1426,7 @@ abstract class Address
/**
* Attempts to retrieve the service name as a string.
*
- * Throws: $(D AddressException) on failure, or $(D SocketFeatureException)
+ * Throws: `AddressException` on failure, or `SocketFeatureException`
* if service name lookup for this address family is not available on the
* current system.
*/
@@ -1453,7 +1453,7 @@ abstract class Address
}
/**
- * $(D UnknownAddress) encapsulates an unknown socket address.
+ * `UnknownAddress` encapsulates an unknown socket address.
*/
class UnknownAddress: Address
{
@@ -1482,7 +1482,7 @@ public:
/**
- * $(D UnknownAddressReference) encapsulates a reference to an arbitrary
+ * `UnknownAddressReference` encapsulates a reference to an arbitrary
* socket address.
*/
class UnknownAddressReference: Address
@@ -1492,14 +1492,14 @@ protected:
socklen_t len;
public:
- /// Constructs an $(D Address) with a reference to the specified $(D sockaddr).
+ /// Constructs an `Address` with a reference to the specified `sockaddr`.
this(sockaddr* sa, socklen_t len) pure nothrow @nogc
{
this.sa = sa;
this.len = len;
}
- /// Constructs an $(D Address) with a copy of the specified $(D sockaddr).
+ /// Constructs an `Address` with a copy of the specified `sockaddr`.
this(const(sockaddr)* sa, socklen_t len) @system pure nothrow
{
this.sa = cast(sockaddr*) (cast(ubyte*)sa)[0..len].dup.ptr;
@@ -1525,10 +1525,10 @@ public:
/**
- * $(D InternetAddress) encapsulates an IPv4 (Internet Protocol version 4)
+ * `InternetAddress` encapsulates an IPv4 (Internet Protocol version 4)
* socket address.
*
- * Consider using $(D getAddress), $(D parseAddress) and $(D Address) methods
+ * Consider using `getAddress`, `parseAddress` and `Address` methods
* instead of using this class directly.
*/
class InternetAddress: Address
@@ -1577,10 +1577,10 @@ public:
}
/**
- * Construct a new $(D InternetAddress).
+ * Construct a new `InternetAddress`.
* Params:
* addr = an IPv4 address string in the dotted-decimal form a.b.c.d,
- * or a host name which will be resolved using an $(D InternetHost)
+ * or a host name which will be resolved using an `InternetHost`
* object.
* port = port number, may be $(D PORT_ANY).
*/
@@ -1602,7 +1602,7 @@ public:
}
/**
- * Construct a new $(D InternetAddress).
+ * Construct a new `InternetAddress`.
* Params:
* addr = (optional) an IPv4 address in host byte order, may be $(D ADDR_ANY).
* port = port number, may be $(D PORT_ANY).
@@ -1637,10 +1637,10 @@ public:
/**
* Attempts to retrieve the host name as a fully qualified domain name.
*
- * Returns: The FQDN corresponding to this $(D InternetAddress), or
- * $(D null) if the host name did not resolve.
+ * Returns: The FQDN corresponding to this `InternetAddress`, or
+ * `null` if the host name did not resolve.
*
- * Throws: $(D AddressException) on error.
+ * Throws: `AddressException` on error.
*/
override string toHostNameString() const
{
@@ -1751,10 +1751,10 @@ unittest
/**
- * $(D Internet6Address) encapsulates an IPv6 (Internet Protocol version 6)
+ * `Internet6Address` encapsulates an IPv6 (Internet Protocol version 6)
* socket address.
*
- * Consider using $(D getAddress), $(D parseAddress) and $(D Address) methods
+ * Consider using `getAddress`, `parseAddress` and `Address` methods
* instead of using this class directly.
*/
class Internet6Address: Address
@@ -1820,10 +1820,10 @@ public:
}
/**
- * Construct a new $(D Internet6Address).
+ * Construct a new `Internet6Address`.
* Params:
* addr = an IPv6 host address string in the form described in RFC 2373,
- * or a host name which will be resolved using $(D getAddressInfo).
+ * or a host name which will be resolved using `getAddressInfo`.
* service = (optional) service name.
*/
this(in char[] addr, in char[] service = null) @trusted
@@ -1834,10 +1834,10 @@ public:
}
/**
- * Construct a new $(D Internet6Address).
+ * Construct a new `Internet6Address`.
* Params:
* addr = an IPv6 host address string in the form described in RFC 2373,
- * or a host name which will be resolved using $(D getAddressInfo).
+ * or a host name which will be resolved using `getAddressInfo`.
* port = port number, may be $(D PORT_ANY).
*/
this(in char[] addr, ushort port)
@@ -1849,7 +1849,7 @@ public:
}
/**
- * Construct a new $(D Internet6Address).
+ * Construct a new `Internet6Address`.
* Params:
* addr = (optional) an IPv6 host address in host byte order, or
* $(D ADDR_ANY).
@@ -1873,7 +1873,7 @@ public:
/**
* Parse an IPv6 host address string as described in RFC 2373, and return the
* address.
- * Throws: $(D SocketException) on error.
+ * Throws: `SocketException` on error.
*/
static ubyte[16] parse(in char[] addr) @trusted
{
@@ -1900,12 +1900,12 @@ unittest
version(StdDdoc)
{
/**
- * $(D UnixAddress) encapsulates an address for a Unix domain socket
+ * `UnixAddress` encapsulates an address for a Unix domain socket
* ($(D AF_UNIX)). Available only on supported systems.
*/
class UnixAddress: Address
{
- /// Construct a new $(D UnixAddress) from the specified path.
+ /// Construct a new `UnixAddress` from the specified path.
this(in char[] path);
/// Get the underlying _path.
@@ -2006,7 +2006,7 @@ static if (is(sockaddr_un))
/**
- * Class for exceptions thrown by $(D Socket.accept).
+ * Class for exceptions thrown by `Socket.accept`.
*/
class SocketAcceptException: SocketOSException
{
@@ -2088,10 +2088,10 @@ struct TimeVal
/**
- * A collection of sockets for use with $(D Socket.select).
+ * A collection of sockets for use with `Socket.select`.
*
- * $(D SocketSet) wraps the platform $(D fd_set) type. However, unlike
- * $(D fd_set), $(D SocketSet) is not statically limited to $(D FD_SETSIZE)
+ * `SocketSet` wraps the platform $(D fd_set) type. However, unlike
+ * $(D fd_set), `SocketSet` is not statically limited to $(D FD_SETSIZE)
* or any other limit, and grows as needed.
*/
class SocketSet
@@ -2207,7 +2207,7 @@ public:
reset();
}
- /// Reset the $(D SocketSet) so that there are 0 $(D Socket)s in the collection.
+ /// Reset the `SocketSet` so that there are 0 `Socket`s in the collection.
void reset() pure nothrow @nogc
{
version (Windows)
@@ -2248,7 +2248,7 @@ public:
}
}
- /// Add a $(D Socket) to the collection.
+ /// Add a `Socket` to the collection.
/// The socket must not already be in the collection.
void add(Socket s) pure nothrow
{
@@ -2276,7 +2276,7 @@ public:
}
- /// Remove this $(D Socket) from the collection.
+ /// Remove this `Socket` from the collection.
/// Does nothing if the socket is not in the collection already.
void remove(Socket s) pure nothrow
{
@@ -2300,17 +2300,17 @@ public:
}
- /// Return nonzero if this $(D Socket) is in the collection.
+ /// Return nonzero if this `Socket` is in the collection.
int isSet(Socket s) const pure nothrow @nogc
{
return isSet(s.sock);
}
- /// Return the current capacity of this $(D SocketSet). The exact
+ /// Return the current capacity of this `SocketSet`. The exact
/// meaning of the return value varies from platform to platform.
/// Note that since D 2.065, this value does not indicate a
- /// restriction, and $(D SocketSet) will grow its capacity as
+ /// restriction, and `SocketSet` will grow its capacity as
/// needed automatically.
@property uint max() const pure nothrow @nogc
{
@@ -2536,7 +2536,7 @@ enum SocketOption: int
/**
- * $(D Socket) is a class that creates a network communication endpoint using
+ * `Socket` is a class that creates a network communication endpoint using
* the Berkeley sockets interface.
*/
class Socket
@@ -2604,7 +2604,7 @@ public:
/**
* Create a blocking socket. If a single protocol type exists to support
- * this socket type within the address family, the $(D ProtocolType) may be
+ * this socket type within the address family, the `ProtocolType` may be
* omitted.
*/
this(AddressFamily af, SocketType type, ProtocolType protocol) @trusted
@@ -2639,7 +2639,7 @@ public:
/**
* Create a blocking socket using the parameters from the specified
- * $(D AddressInfo) structure.
+ * `AddressInfo` structure.
*/
this(in AddressInfo info)
{
@@ -2770,9 +2770,9 @@ public:
}
/**
- * Listen for an incoming connection. $(D bind) must be called before you
- * can $(D listen). The $(D backlog) is a request of how many pending
- * incoming connections are queued until $(D accept)ed.
+ * Listen for an incoming connection. `bind` must be called before you
+ * can `listen`. The `backlog` is a request of how many pending
+ * incoming connections are queued until `accept`ed.
*/
void listen(int backlog) @trusted
{
@@ -2781,10 +2781,10 @@ public:
}
/**
- * Called by $(D accept) when a new $(D Socket) must be created for a new
+ * Called by `accept` when a new `Socket` must be created for a new
* connection. To use a derived class, override this method and return an
- * instance of your class. The returned $(D Socket)'s handle must not be
- * set; $(D Socket) has a protected constructor $(D this()) to use in this
+ * instance of your class. The returned `Socket`'s handle must not be
+ * set; `Socket` has a protected constructor `this()` to use in this
* situation.
*/
// Override to use a derived class.
@@ -2795,9 +2795,9 @@ public:
}
/**
- * Accept an incoming connection. If the socket is blocking, $(D accept)
- * waits for a connection request. Throws $(D SocketAcceptException) if
- * unable to _accept. See $(D accepting) for use with derived classes.
+ * Accept an incoming connection. If the socket is blocking, `accept`
+ * waits for a connection request. Throws `SocketAcceptException` if
+ * unable to _accept. See `accepting` for use with derived classes.
*/
Socket accept() @trusted
{
@@ -2847,9 +2847,9 @@ public:
/**
* Immediately drop any connections and release socket resources.
- * Calling $(D shutdown) before $(D close) is recommended for
- * connection-oriented sockets. The $(D Socket) object is no longer
- * usable after $(D close).
+ * Calling `shutdown` before `close` is recommended for
+ * connection-oriented sockets. The `Socket` object is no longer
+ * usable after `close`.
*/
//calling shutdown() before this is recommended
//for connection-oriented sockets
@@ -2870,7 +2870,7 @@ public:
return to!string(result.ptr);
}
- /// Remote endpoint $(D Address).
+ /// Remote endpoint `Address`.
@property Address remoteAddress() @trusted
{
Address addr = createAddress();
@@ -2883,7 +2883,7 @@ public:
return addr;
}
- /// Local endpoint $(D Address).
+ /// Local endpoint `Address`.
@property Address localAddress() @trusted
{
Address addr = createAddress();
@@ -2897,16 +2897,16 @@ public:
}
/**
- * Send or receive error code. See $(D wouldHaveBlocked),
- * $(D lastSocketError) and $(D Socket.getErrorText) for obtaining more
+ * Send or receive error code. See `wouldHaveBlocked`,
+ * `lastSocketError` and `Socket.getErrorText` for obtaining more
* information about the error.
*/
enum int ERROR = _SOCKET_ERROR;
/**
* Send data on the connection. If the socket is blocking and there is no
- * buffer space left, $(D send) waits.
- * Returns: The number of bytes actually sent, or $(D Socket.ERROR) on
+ * buffer space left, `send` waits.
+ * Returns: The number of bytes actually sent, or `Socket.ERROR` on
* failure.
*/
//returns number of bytes actually sent, or -1 on error
@@ -2932,8 +2932,8 @@ public:
/**
* Send data to a specific destination Address. If the destination address is
* not specified, a connection must have been made and that address is used.
- * If the socket is blocking and there is no buffer space left, $(D sendTo) waits.
- * Returns: The number of bytes actually sent, or $(D Socket.ERROR) on
+ * If the socket is blocking and there is no buffer space left, `sendTo` waits.
+ * Returns: The number of bytes actually sent, or `Socket.ERROR` on
* failure.
*/
ptrdiff_t sendTo(const(void)[] buf, SocketFlags flags, Address to) @trusted
@@ -2982,10 +2982,10 @@ public:
/**
- * Receive data on the connection. If the socket is blocking, $(D receive)
+ * Receive data on the connection. If the socket is blocking, `receive`
* waits until there is data to be received.
- * Returns: The number of bytes actually received, $(D 0) if the remote side
- * has closed the connection, or $(D Socket.ERROR) on failure.
+ * Returns: The number of bytes actually received, `0` if the remote side
+ * has closed the connection, or `Socket.ERROR` on failure.
*/
//returns number of bytes actually received, 0 on connection closure, or -1 on error
ptrdiff_t receive(void[] buf, SocketFlags flags) @trusted
@@ -3009,11 +3009,11 @@ public:
}
/**
- * Receive data and get the remote endpoint $(D Address).
- * If the socket is blocking, $(D receiveFrom) waits until there is data to
+ * Receive data and get the remote endpoint `Address`.
+ * If the socket is blocking, `receiveFrom` waits until there is data to
* be received.
- * Returns: The number of bytes actually received, $(D 0) if the remote side
- * has closed the connection, or $(D Socket.ERROR) on failure.
+ * Returns: The number of bytes actually received, `0` if the remote side
+ * has closed the connection, or `Socket.ERROR` on failure.
*/
ptrdiff_t receiveFrom(void[] buf, SocketFlags flags, ref Address from) @trusted
{
@@ -3072,7 +3072,7 @@ public:
/// Get a socket option.
- /// Returns: The number of bytes written to $(D result).
+ /// Returns: The number of bytes written to `result`.
//returns the length, in bytes, of the actual result - very different from getsockopt()
int getOption(SocketOptionLevel level, SocketOption option, void[] result) @trusted
{
@@ -3145,8 +3145,8 @@ public:
}
/**
- * Sets a timeout (duration) option, i.e. $(D SocketOption.SNDTIMEO) or
- * $(D RCVTIMEO). Zero indicates no timeout.
+ * Sets a timeout (duration) option, i.e. `SocketOption.SNDTIMEO` or
+ * `RCVTIMEO`. Zero indicates no timeout.
*
* In a typical application, you might also want to consider using
* a non-blocking socket instead of setting a timeout on a blocking one.
@@ -3155,17 +3155,17 @@ public:
* on *nix systems even for smaller durations, there are two issues to
* be aware of on Windows: First, although undocumented, the effective
* timeout duration seems to be the one set on the socket plus half
- * a second. $(D setOption()) tries to compensate for that, but still,
+ * a second. `setOption()` tries to compensate for that, but still,
* timeouts under 500ms are not possible on Windows. Second, be aware
* that the actual amount of time spent until a blocking call returns
* randomly varies on the order of 10ms.
*
* Params:
* level = The level at which a socket option is defined.
- * option = Either $(D SocketOption.SNDTIMEO) or $(D SocketOption.RCVTIMEO).
+ * option = Either `SocketOption.SNDTIMEO` or `SocketOption.RCVTIMEO`.
* value = The timeout duration to set. Must not be negative.
*
- * Throws: $(D SocketException) if setting the options fails.
+ * Throws: `SocketException` if setting the options fails.
*
* Example:
* ---
@@ -3227,8 +3227,8 @@ public:
* interval = Number of seconds between when successive keep-alive
* packets are sent if no acknowledgement is received.
*
- * Throws: $(D SocketOSException) if setting the options fails, or
- * $(D SocketFeatureException) if setting keep-alive parameters is
+ * Throws: `SocketOSException` if setting the options fails, or
+ * `SocketFeatureException` if setting keep-alive parameters is
* unsupported on the current platform.
*/
void setKeepAlive(int time, int interval) @trusted
@@ -3260,12 +3260,12 @@ public:
/**
* Wait for a socket to change status. A wait timeout of $(Duration) or
- * $(D TimeVal), may be specified; if a timeout is not specified or the
- * $(D TimeVal) is $(D null), the maximum timeout is used. The $(D TimeVal)
- * timeout has an unspecified value when $(D select) returns.
- * Returns: The number of sockets with status changes, $(D 0) on timeout,
- * or $(D -1) on interruption. If the return value is greater than $(D 0),
- * the $(D SocketSets) are updated to only contain the sockets having status
+ * `TimeVal`, may be specified; if a timeout is not specified or the
+ * `TimeVal` is `null`, the maximum timeout is used. The `TimeVal`
+ * timeout has an unspecified value when `select` returns.
+ * Returns: The number of sockets with status changes, `0` on timeout,
+ * or `-1` on interruption. If the return value is greater than `0`,
+ * the `SocketSets` are updated to only contain the sockets having status
* changes. For a connecting socket, a write status change means the
* connection is established and it's able to send. For a listening socket,
* a read status change means there is an incoming connection request and
@@ -3422,7 +3422,7 @@ public:
}
-/// $(D TcpSocket) is a shortcut class for a TCP Socket.
+/// `TcpSocket` is a shortcut class for a TCP Socket.
class TcpSocket: Socket
{
/// Constructs a blocking TCP Socket.
@@ -3439,7 +3439,7 @@ class TcpSocket: Socket
//shortcut
- /// Constructs a blocking TCP Socket and connects to an $(D Address).
+ /// Constructs a blocking TCP Socket and connects to an `Address`.
this(Address connectTo)
{
this(connectTo.addressFamily);
@@ -3448,7 +3448,7 @@ class TcpSocket: Socket
}
-/// $(D UdpSocket) is a shortcut class for a UDP Socket.
+/// `UdpSocket` is a shortcut class for a UDP Socket.
class UdpSocket: Socket
{
/// Constructs a blocking UDP Socket.
@@ -3470,7 +3470,7 @@ class UdpSocket: Socket
*
* The two sockets are indistinguishable.
*
- * Throws: $(D SocketException) if creation of the sockets fails.
+ * Throws: `SocketException` if creation of the sockets fails.
*
* Example:
* ---
diff --git a/std/socketstream.d b/std/socketstream.d
index e89358eb6a4..4e8585a651c 100644
--- a/std/socketstream.d
+++ b/std/socketstream.d
@@ -25,8 +25,8 @@
* current standards. It will remain until we have a suitable replacement,
* but be aware that it will not remain long term.)
*
- * $(D SocketStream) is a stream for a blocking,
- * connected $(D Socket).
+ * `SocketStream` is a stream for a blocking,
+ * connected `Socket`.
*
* Example:
* See $(SAMPLESRC htmlget.d)
@@ -43,8 +43,8 @@ private import std.stream;
private import std.socket;
/**************
- * $(D SocketStream) is a stream for a blocking,
- * connected $(D Socket).
+ * `SocketStream` is a stream for a blocking,
+ * connected `Socket`.
*/
class SocketStream: Stream
{
@@ -76,7 +76,7 @@ class SocketStream: Stream
}
/**
- * Property to get the $(D Socket) that is being streamed.
+ * Property to get the `Socket` that is being streamed.
*/
Socket socket()
{
@@ -121,7 +121,7 @@ class SocketStream: Stream
/**
* Socket streams do not support seeking. This disabled method throws
- * a $(D SeekException).
+ * a `SeekException`.
*/
@disable override ulong seek(long offset, SeekPos whence)
{
@@ -138,7 +138,7 @@ class SocketStream: Stream
}
/**
- * Close the $(D Socket).
+ * Close the `Socket`.
*/
override void close()
{
diff --git a/std/stdio.d b/std/stdio.d
index 1fe7c9f79c4..1ab460a746a 100644
--- a/std/stdio.d
+++ b/std/stdio.d
@@ -25,7 +25,7 @@ import std.traits;// Unqual, isSomeChar, isSomeString
/++
-If flag $(D KeepTerminator) is set to $(D KeepTerminator.yes), then the delimiter
+If flag `KeepTerminator` is set to `KeepTerminator.yes`, then the delimiter
is included in the strings returned.
+/
alias KeepTerminator = Flag!"keepTerminator";
@@ -278,19 +278,19 @@ template byRecord(Fields...)
}
/**
-Encapsulates a $(D FILE*). Generally D does not attempt to provide
+Encapsulates a `FILE*`. Generally D does not attempt to provide
thin wrappers over equivalent functions in the C standard library, but
-manipulating $(D FILE*) values directly is unsafe and error-prone in
-many ways. The $(D File) type ensures safe manipulation, automatic
+manipulating `FILE*` values directly is unsafe and error-prone in
+many ways. The `File` type ensures safe manipulation, automatic
file closing, and a lot of convenience.
-The underlying $(D FILE*) handle is maintained in a reference-counted
-manner, such that as soon as the last $(D File) variable bound to a
-given $(D FILE*) goes out of scope, the underlying $(D FILE*) is
+The underlying `FILE*` handle is maintained in a reference-counted
+manner, such that as soon as the last `File` variable bound to a
+given `FILE*` goes out of scope, the underlying `FILE*` is
automatically closed.
Bugs:
-$(D File) expects file names to be encoded in $(B CP_ACP) on $(I Windows)
+`File` expects file names to be encoded in $(B CP_ACP) on $(I Windows)
instead of UTF-8 ($(BUGZILLA 7648)) thus must not be used in $(I Windows)
or cross-platform applications other than with an immediate ASCII string as
a file name to prevent accidental changes to result in incorrect behavior.
@@ -313,7 +313,7 @@ void main(string args[])
}
f.writeln("!");
// f exits scope, reference count falls to zero,
- // underlying $(D FILE*) is closed.
+ // underlying `FILE*` is closed.
}
----
@@ -356,13 +356,13 @@ Constructor taking the name of the file to open and the open mode
cplusplus.com/reference/clibrary/cstdio/fopen.html, fopen)
function).
-Copying one $(D File) object to another results in the two $(D File)
+Copying one `File` object to another results in the two `File`
objects referring to the same underlying file.
-The destructor automatically closes the file as soon as no $(D File)
+The destructor automatically closes the file as soon as no `File`
object refers to it anymore.
-Throws: $(D ErrnoException) if the file could not be opened.
+Throws: `ErrnoException` if the file could not be opened.
*/
this(string name, in char[] stdioOpenmode = "rb") @safe
{
@@ -400,12 +400,12 @@ file.
}
/**
-First calls $(D detach) (throwing on failure), and then attempts to
-_open file $(D name) with mode $(D stdioOpenmode). The mode has the
+First calls `detach` (throwing on failure), and then attempts to
+_open file `name` with mode `stdioOpenmode`. The mode has the
same semantics as in the C standard library $(WEB
cplusplus.com/reference/clibrary/cstdio/fopen.html, fopen) function.
-Throws: $(D ErrnoException) in case of error.
+Throws: `ErrnoException` in case of error.
*/
void open(string name, in char[] stdioOpenmode = "rb") @safe
{
@@ -414,11 +414,11 @@ Throws: $(D ErrnoException) in case of error.
}
/**
-First calls $(D detach) (throwing on failure), and then runs a command
+First calls `detach` (throwing on failure), and then runs a command
by calling the C standard library function $(WEB
opengroup.org/onlinepubs/007908799/xsh/_popen.html, _popen).
-Throws: $(D ErrnoException) in case of error.
+Throws: `ErrnoException` in case of error.
*/
version(Posix) void popen(string command, in char[] stdioOpenmode = "r") @safe
{
@@ -431,11 +431,11 @@ Throws: $(D ErrnoException) in case of error.
}
/**
-First calls $(D detach) (throwing on failure), and then attempts to
-associate the given file descriptor with the $(D File). The mode must
+First calls `detach` (throwing on failure), and then attempts to
+associate the given file descriptor with the `File`. The mode must
be compatible with the mode of the file descriptor.
-Throws: $(D ErrnoException) in case of error.
+Throws: `ErrnoException` in case of error.
*/
void fdopen(int fd, in char[] stdioOpenmode = "rb") @safe
{
@@ -484,11 +484,11 @@ Throws: $(D ErrnoException) in case of error.
version(StdDdoc) { version(Windows) {} else alias HANDLE = int; }
/**
-First calls $(D detach) (throwing on failure), and then attempts to
-associate the given Windows $(D HANDLE) with the $(D File). The mode must
+First calls `detach` (throwing on failure), and then attempts to
+associate the given Windows `HANDLE` with the `File`. The mode must
be compatible with the access attributes of the handle. Windows only.
-Throws: $(D ErrnoException) in case of error.
+Throws: `ErrnoException` in case of error.
*/
version(StdDdoc)
void windowsHandleOpen(HANDLE handle, in char[] stdioOpenmode);
@@ -526,17 +526,17 @@ Throws: $(D ErrnoException) in case of error.
}
-/** Returns $(D true) if the file is opened. */
+/** Returns `true` if the file is opened. */
@property bool isOpen() const @safe pure nothrow
{
return _p !is null && _p.handle;
}
/**
-Returns $(D true) if the file is at end (see $(WEB
+Returns `true` if the file is at end (see $(WEB
cplusplus.com/reference/clibrary/cstdio/feof.html, feof)).
-Throws: $(D Exception) if the file is not opened.
+Throws: `Exception` if the file is not opened.
*/
@property bool eof() const @trusted pure
{
@@ -547,7 +547,7 @@ Throws: $(D Exception) if the file is not opened.
}
/** Returns the name of the last opened file, if any.
-If a $(D File) was created with $(LREF tmpfile) and $(LREF wrapFile)
+If a `File` was created with $(LREF tmpfile) and $(LREF wrapFile)
it has no name.*/
@property string name() const @safe pure nothrow
{
@@ -555,7 +555,7 @@ it has no name.*/
}
/**
-If the file is not opened, returns $(D false). Otherwise, returns
+If the file is not opened, returns `false`. Otherwise, returns
$(WEB cplusplus.com/reference/clibrary/cstdio/ferror.html, ferror) for
the file handle.
*/
@@ -577,9 +577,9 @@ the file handle.
}
/**
-Detaches from the underlying file. If the sole owner, calls $(D close).
+Detaches from the underlying file. If the sole owner, calls `close`.
-Throws: $(D ErrnoException) on failure if closing the file.
+Throws: `ErrnoException` on failure if closing the file.
*/
void detach() @safe
{
@@ -614,11 +614,11 @@ If the file was unopened, succeeds vacuously. Otherwise closes the
file (by calling $(WEB
cplusplus.com/reference/clibrary/cstdio/fclose.html, fclose)),
throwing on error. Even if an exception is thrown, afterwards the $(D
-File) object is empty. This is different from $(D detach) in that it
-always closes the file; consequently, all other $(D File) objects
+File) object is empty. This is different from `detach` in that it
+always closes the file; consequently, all other `File` objects
referring to the same handle will see a closed file henceforth.
-Throws: $(D ErrnoException) on error.
+Throws: `ErrnoException` on error.
*/
void close() @trusted
{
@@ -670,7 +670,7 @@ _clearerr) for the file handle.
Calls $(WEB cplusplus.com/reference/clibrary/cstdio/_fflush.html, _fflush)
for the file handle.
-Throws: $(D Exception) if the file is not opened or if the call to $(D fflush) fails.
+Throws: `Exception` if the file is not opened or if the call to `fflush` fails.
*/
void flush() @trusted
{
@@ -699,14 +699,14 @@ Calls $(WEB cplusplus.com/reference/clibrary/cstdio/fread.html, fread) for the
file handle. The number of items to read and the size of
each item is inferred from the size and type of the input array, respectively.
-Returns: The slice of $(D buffer) containing the data that was actually read.
-This will be shorter than $(D buffer) if EOF was reached before the buffer
+Returns: The slice of `buffer` containing the data that was actually read.
+This will be shorter than `buffer` if EOF was reached before the buffer
could be filled.
-Throws: $(D Exception) if $(D buffer) is empty.
- $(D ErrnoException) if the file is not opened or the call to $(D fread) fails.
+Throws: `Exception` if `buffer` is empty.
+ `ErrnoException` if the file is not opened or the call to `fread` fails.
-$(D rawRead) always reads in binary mode on Windows.
+`rawRead` always reads in binary mode on Windows.
*/
T[] rawRead(T)(T[] buffer)
{
@@ -757,9 +757,9 @@ handle. The number of items to write and the size of each
item is inferred from the size and type of the input array, respectively. An
error is thrown if the buffer could not be written in its entirety.
-$(D rawWrite) always writes in binary mode on Windows.
+`rawWrite` always writes in binary mode on Windows.
-Throws: $(D ErrnoException) if the file is not opened or if the call to $(D fwrite) fails.
+Throws: `ErrnoException` if the file is not opened or if the call to `fwrite` fails.
*/
void rawWrite(T)(in T[] buffer)
{
@@ -808,8 +808,8 @@ Throws: $(D ErrnoException) if the file is not opened or if the call to $(D fwri
Calls $(WEB cplusplus.com/reference/clibrary/cstdio/fseek.html, fseek)
for the file handle.
-Throws: $(D Exception) if the file is not opened.
- $(D ErrnoException) if the call to $(D fseek) fails.
+Throws: `Exception` if the file is not opened.
+ `ErrnoException` if the call to `fseek` fails.
*/
void seek(long offset, int origin = SEEK_SET) @trusted
{
@@ -867,8 +867,8 @@ Throws: $(D Exception) if the file is not opened.
Calls $(WEB cplusplus.com/reference/clibrary/cstdio/ftell.html, ftell) for the
managed file handle.
-Throws: $(D Exception) if the file is not opened.
- $(D ErrnoException) if the call to $(D ftell) fails.
+Throws: `Exception` if the file is not opened.
+ `ErrnoException` if the call to `ftell` fails.
*/
@property ulong tell() const @trusted
{
@@ -907,7 +907,7 @@ Throws: $(D Exception) if the file is not opened.
Calls $(WEB cplusplus.com/reference/clibrary/cstdio/_rewind.html, _rewind)
for the file handle.
-Throws: $(D Exception) if the file is not opened.
+Throws: `Exception` if the file is not opened.
*/
void rewind() @safe
{
@@ -921,8 +921,8 @@ Throws: $(D Exception) if the file is not opened.
Calls $(WEB cplusplus.com/reference/clibrary/cstdio/_setvbuf.html, _setvbuf) for
the file handle.
-Throws: $(D Exception) if the file is not opened.
- $(D ErrnoException) if the call to $(D setvbuf) fails.
+Throws: `Exception` if the file is not opened.
+ `ErrnoException` if the call to `setvbuf` fails.
*/
void setvbuf(size_t size, int mode = _IOFBF) @trusted
{
@@ -937,8 +937,8 @@ Throws: $(D Exception) if the file is not opened.
Calls $(WEB cplusplus.com/reference/clibrary/cstdio/_setvbuf.html,
_setvbuf) for the file handle.
-Throws: $(D Exception) if the file is not opened.
- $(D ErrnoException) if the call to $(D setvbuf) fails.
+Throws: `Exception` if the file is not opened.
+ `ErrnoException` if the call to `setvbuf` fails.
*/
void setvbuf(void[] buf, int mode = _IOFBF) @trusted
{
@@ -1001,14 +1001,14 @@ Throws: $(D Exception) if the file is not opened.
/**
Locks the specified file segment. If the file segment is already locked
by another process, waits until the existing lock is released.
-If both $(D start) and $(D length) are zero, the entire file is locked.
+If both `start` and `length` are zero, the entire file is locked.
-Locks created using $(D lock) and $(D tryLock) have the following properties:
+Locks created using `lock` and `tryLock` have the following properties:
$(UL
$(LI All locks are automatically released when the process terminates.)
$(LI Locks are not inherited by child processes.)
$(LI Closing a file will release all locks associated with the file. On POSIX,
- even locks acquired via a different $(D File) will be released as well.)
+ even locks acquired via a different `File` will be released as well.)
$(LI Not all NFS implementations correctly implement file locking.)
)
*/
@@ -1040,8 +1040,8 @@ $(UL
/**
Attempts to lock the specified file segment.
-If both $(D start) and $(D length) are zero, the entire file is locked.
-Returns: $(D true) if the lock was successful, and $(D false) if the
+If both `start` and `length` are zero, the entire file is locked.
+Returns: `true` if the lock was successful, and `false` if the
specified file segment was already locked.
*/
bool tryLock(LockType lockType = LockType.readWrite,
@@ -1183,8 +1183,8 @@ Removes the lock over the specified file segment.
/**
Writes its arguments in text format to the file.
-Throws: $(D Exception) if the file is not opened.
- $(D ErrnoException) on an error writing to the file.
+Throws: `Exception` if the file is not opened.
+ `ErrnoException` on an error writing to the file.
*/
void write(S...)(S args)
{
@@ -1232,8 +1232,8 @@ Throws: $(D Exception) if the file is not opened.
/**
Writes its arguments in text format to the file, followed by a newline.
-Throws: $(D Exception) if the file is not opened.
- $(D ErrnoException) on an error writing to the file.
+Throws: `Exception` if the file is not opened.
+ `ErrnoException` on an error writing to the file.
*/
void writeln(S...)(S args)
{
@@ -1244,8 +1244,8 @@ Throws: $(D Exception) if the file is not opened.
Writes its arguments in text format to the file, according to the
format in the first argument.
-Throws: $(D Exception) if the file is not opened.
- $(D ErrnoException) on an error writing to the file.
+Throws: `Exception` if the file is not opened.
+ `ErrnoException` on an error writing to the file.
*/
void writef(Char, A...)(in Char[] fmt, A args)
{
@@ -1258,8 +1258,8 @@ Throws: $(D Exception) if the file is not opened.
Writes its arguments in text format to the file, according to the
format in the first argument, followed by a newline.
-Throws: $(D Exception) if the file is not opened.
- $(D ErrnoException) on an error writing to the file.
+Throws: `Exception` if the file is not opened.
+ `ErrnoException` on an error writing to the file.
*/
void writefln(Char, A...)(in Char[] fmt, A args)
{
@@ -1274,12 +1274,12 @@ Throws: $(D Exception) if the file is not opened.
Read line from the file handle and return it as a specified type.
This version manages its own read buffer, which means one memory allocation per call. If you are not
-retaining a reference to the read data, consider the $(D File.readln(buf)) version, which may offer
+retaining a reference to the read data, consider the `File.readln(buf)` version, which may offer
better performance as it can reuse its read buffer.
Params:
- S = Template parameter; the type of the allocated buffer, and the type returned. Defaults to $(D string).
- terminator = Line terminator (by default, $(D '\n')).
+ S = Template parameter; the type of the allocated buffer, and the type returned. Defaults to `string`.
+ terminator = Line terminator (by default, `'\n'`).
Note:
String terminators are not supported due to ambiguity with readln(buf) below.
@@ -1288,11 +1288,11 @@ Returns:
The line that was read, including the line terminator character.
Throws:
- $(D StdioException) on I/O error, or $(D UnicodeException) on Unicode conversion error.
+ `StdioException` on I/O error, or `UnicodeException` on Unicode conversion error.
Example:
---
-// Reads $(D stdin) and writes it to $(D stdout).
+// Reads `stdin` and writes it to `stdout`.
import std.stdio;
void main()
@@ -1354,7 +1354,7 @@ void main()
}
/**
-Read line from the file handle and write it to $(D buf[]), including
+Read line from the file handle and write it to `buf[]`, including
terminating character.
This can be faster than $(D line = File.readln()) because you can reuse
@@ -1364,21 +1364,21 @@ must copy the previous contents if you wish to retain them.
Params:
buf = Buffer used to store the resulting line data. buf is
resized as necessary.
-terminator = Line terminator (by default, $(D '\n')). Use
+terminator = Line terminator (by default, `'\n'`). Use
$(XREF ascii, newline) for portability (unless the file was opened in
text mode).
Returns:
0 for end of file, otherwise number of characters read
-Throws: $(D StdioException) on I/O error, or $(D UnicodeException) on Unicode
+Throws: `StdioException` on I/O error, or `UnicodeException` on Unicode
conversion error.
Example:
---
-// Read lines from $(D stdin) into a string
+// Read lines from `stdin` into a string
// Ignore lines starting with '#'
-// Write the string to $(D stdout)
+// Write the string to `stdout`
void main()
{
@@ -1398,8 +1398,8 @@ void main()
---
This method can be more efficient than the one in the previous example
-because $(D stdin.readln(buf)) reuses (if possible) memory allocated
-for $(D buf), whereas $(D line = stdin.readln()) makes a new memory allocation
+because `stdin.readln(buf)` reuses (if possible) memory allocated
+for `buf`, whereas $(D line = stdin.readln()) makes a new memory allocation
for every line.
*/
size_t readln(C)(ref C[] buf, dchar terminator = '\n')
@@ -1522,7 +1522,7 @@ for every line.
}
/**
-Unsafe function that wraps an existing $(D FILE*). The resulting $(D
+Unsafe function that wraps an existing `FILE*`. The resulting $(D
File) never takes the initiative in closing the file.
Note that the created file has no $(LREF name)*/
/*private*/ static File wrapFile(FILE* f) @safe
@@ -1534,7 +1534,7 @@ Note that the created file has no $(LREF name)*/
}
/**
-Returns the $(D FILE*) corresponding to this object.
+Returns the `FILE*` corresponding to this object.
*/
FILE* getFP() @safe pure
{
@@ -1563,7 +1563,7 @@ Returns the file number corresponding to this object.
}
/**
-Returns the underlying operating system $(D HANDLE) (Windows only).
+Returns the underlying operating system `HANDLE` (Windows only).
*/
version(StdDdoc)
@property HANDLE windowsHandle();
@@ -1703,21 +1703,21 @@ Allows to directly use range operations on lines of a file.
Returns an input range set up to read from the file handle one line
at a time.
-The element type for the range will be $(D Char[]). Range primitives
-may throw $(D StdioException) on I/O error.
+The element type for the range will be `Char[]`. Range primitives
+may throw `StdioException` on I/O error.
Note:
-Each $(D front) will not persist after $(D
+Each `front` will not persist after $(D
popFront) is called, so the caller must copy its contents (e.g. by
-calling $(D to!string)) when retention is needed. If the caller needs
+calling `to!string`) when retention is needed. If the caller needs
to retain a copy of every line, use the $(LREF byLineCopy) function
instead.
Params:
-Char = Character type for each line, defaulting to $(D char).
-keepTerminator = Use $(D KeepTerminator.yes) to include the
+Char = Character type for each line, defaulting to `char`.
+keepTerminator = Use `KeepTerminator.yes` to include the
terminator at the end of each line.
-terminator = Line separator ($(D '\n') by default). Use
+terminator = Line separator (`'\n'` by default). Use
$(XREF ascii, newline) for portability (unless the file was opened in
text mode).
@@ -1756,7 +1756,7 @@ void main()
}
----
Notice that neither example accesses the line data returned by
-$(D front) after the corresponding $(D popFront) call is made (because
+`front` after the corresponding `popFront` call is made (because
the contents may well have changed).
*/
auto byLine(Terminator = char, Char = char)
@@ -1846,20 +1846,20 @@ the contents may well have changed).
/**
Returns an input range set up to read from the file handle one line
-at a time. Each line will be newly allocated. $(D front) will cache
+at a time. Each line will be newly allocated. `front` will cache
its value to allow repeated calls without unnecessary allocations.
Note: Due to caching byLineCopy can be more memory-efficient than
-$(D File.byLine.map!idup).
+`File.byLine.map!idup`.
-The element type for the range will be $(D Char[]). Range
-primitives may throw $(D StdioException) on I/O error.
+The element type for the range will be `Char[]`. Range
+primitives may throw `StdioException` on I/O error.
Params:
Char = Character type for each line, defaulting to $(D immutable char).
-keepTerminator = Use $(D KeepTerminator.yes) to include the
+keepTerminator = Use `KeepTerminator.yes` to include the
terminator at the end of each line.
-terminator = Line separator ($(D '\n') by default). Use
+terminator = Line separator (`'\n'` by default). Use
$(XREF ascii, newline) for portability (unless the file was opened in
text mode).
@@ -2107,7 +2107,7 @@ $(XREF file,readText)
prime();
}
- // $(D ByChunk)'s input range primitive operations.
+ // `ByChunk`'s input range primitive operations.
@property nothrow
bool empty() const
{
@@ -2144,8 +2144,8 @@ $(XREF file,readText)
Returns an input range set up to read from the file handle a chunk at a
time.
-The element type for the range will be $(D ubyte[]). Range primitives
-may throw $(D StdioException) on I/O error.
+The element type for the range will be `ubyte[]`. Range primitives
+may throw `StdioException` on I/O error.
Example:
---------
@@ -2160,7 +2160,7 @@ void main()
---------
The parameter may be a number (as shown in the example above) dictating the
-size of each chunk. Alternatively, $(D byChunk) accepts a
+size of each chunk. Alternatively, `byChunk` accepts a
user-provided buffer that it uses directly.
Example:
@@ -2176,14 +2176,14 @@ void main()
---------
In either case, the content of the buffer is reused across calls. That means
-$(D front) will not persist after $(D popFront) is called, so if retention is
-needed, the caller must copy its contents (e.g. by calling $(D buffer.dup)).
+`front` will not persist after `popFront` is called, so if retention is
+needed, the caller must copy its contents (e.g. by calling `buffer.dup`).
-In the example above, $(D buffer.length) is 4096 for all iterations, except
-for the last one, in which case $(D buffer.length) may be less than 4096 (but
+In the example above, `buffer.length` is 4096 for all iterations, except
+for the last one, in which case `buffer.length` may be less than 4096 (but
always greater than zero).
-With the mentioned limitations, $(D byChunks) works with any algorithm
+With the mentioned limitations, `byChunks` works with any algorithm
compatible with input ranges.
Example:
@@ -2196,12 +2196,12 @@ void main()
}
---
-Returns: A call to $(D byChunk) returns a range initialized with the $(D File)
+Returns: A call to `byChunk` returns a range initialized with the `File`
object and the appropriate buffer.
Throws: If the user-provided size is zero or the user-provided buffer
-is empty, throws an $(D Exception). In case of an I/O error throws
-$(D StdioException).
+is empty, throws an `Exception`. In case of an I/O error throws
+`StdioException`.
*/
auto byChunk(size_t chunkSize)
{
@@ -2265,7 +2265,7 @@ $(D StdioException).
// Note: This was documented until 2013/08
/*
-$(D Range) that locks the file and allows fast writing to it.
+`Range` that locks the file and allows fast writing to it.
*/
struct LockingTextWriter
{
@@ -2637,7 +2637,7 @@ unittest
assert(File(deleteme).readln() == "日本語日本語日本語日本語############");
}
-/// Used to specify the lock type for $(D File.lock) and $(D File.tryLock).
+/// Used to specify the lock type for `File.lock` and `File.tryLock`.
enum LockType
{
/// Specifies a _read (shared) lock. A _read lock denies all processes
@@ -2826,7 +2826,7 @@ unittest // bugzilla 12320
}
/**
- * Indicates whether $(D T) is a file handle of some kind.
+ * Indicates whether `T` is a file handle of some kind.
*/
template isFileHandle(T)
{
@@ -2841,7 +2841,7 @@ unittest
}
/**
- * $(RED Deprecated. Please use $(D isFileHandle) instead. This alias will be
+ * $(RED Deprecated. Please use `isFileHandle` instead. This alias will be
* removed in June 2015.)
*/
deprecated("Please use isFileHandle instead.")
@@ -2853,12 +2853,12 @@ alias isStreamingDevice = isFileHandle;
private @property File trustedStdout() @trusted { return stdout; }
/***********************************
-For each argument $(D arg) in $(D args), format the argument (as per
+For each argument `arg` in `args`, format the argument (as per
$(LINK2 std_conv.html, to!(string)(arg))) and write the resulting
-string to $(D args[0]). A call without any arguments will fail to
+string to `args[0]`. A call without any arguments will fail to
compile.
-Throws: In case of an I/O error, throws an $(D StdioException).
+Throws: In case of an I/O error, throws an `StdioException`.
*/
void write(T...)(T args) if (!is(T[0] : File))
{
@@ -2892,7 +2892,7 @@ unittest
}
/***********************************
- * Equivalent to $(D write(args, '\n')). Calling $(D writeln) without
+ * Equivalent to $(D write(args, '\n')). Calling `writeln` without
* arguments is valid and just prints a newline to the standard
* output.
*/
@@ -3035,7 +3035,7 @@ unittest
Writes formatted data to standard output (without a trailing newline).
Params:
-args = The first argument $(D args[0]) should be the format string, specifying
+args = The first argument `args[0]` should be the format string, specifying
how to format the rest of the arguments. For a full description of the syntax
of the format string and how it controls the formatting of the rest of the
arguments, please refer to the documentation for $(XREF format,
@@ -3047,7 +3047,7 @@ Note: In older versions of Phobos, it used to be possible to write:
writef(stderr, "%s", "message");
------
-to print a message to $(D stderr). This syntax is no longer supported, and has
+to print a message to `stderr`. This syntax is no longer supported, and has
been superceded by:
------
@@ -3133,7 +3133,7 @@ unittest
}
/**
- * Read data from $(D stdin) according to the specified
+ * Read data from `stdin` according to the specified
* $(LINK2 std_format.html#format-string, format specifier) using
* $(XREF format,formattedRead).
*/
@@ -3154,23 +3154,23 @@ unittest
}
/**********************************
- * Read line from $(D stdin).
+ * Read line from `stdin`.
*
* This version manages its own read buffer, which means one memory allocation per call. If you are not
- * retaining a reference to the read data, consider the $(D readln(buf)) version, which may offer
+ * retaining a reference to the read data, consider the `readln(buf)` version, which may offer
* better performance as it can reuse its read buffer.
*
* Returns:
* The line that was read, including the line terminator character.
* Params:
- * S = Template parameter; the type of the allocated buffer, and the type returned. Defaults to $(D string).
- * terminator = Line terminator (by default, $(D '\n')).
+ * S = Template parameter; the type of the allocated buffer, and the type returned. Defaults to `string`.
+ * terminator = Line terminator (by default, `'\n'`).
* Note:
* String terminators are not supported due to ambiguity with readln(buf) below.
* Throws:
- * $(D StdioException) on I/O error, or $(D UnicodeException) on Unicode conversion error.
+ * `StdioException` on I/O error, or `UnicodeException` on Unicode conversion error.
* Example:
- * Reads $(D stdin) and writes it to $(D stdout).
+ * Reads `stdin` and writes it to `stdout`.
---
import std.stdio;
@@ -3189,7 +3189,7 @@ if (isSomeString!S)
}
/**********************************
- * Read line from $(D stdin) and write it to buf[], including terminating character.
+ * Read line from `stdin` and write it to buf[], including terminating character.
*
* This can be faster than $(D line = readln()) because you can reuse
* the buffer for each call. Note that reusing the buffer means that you
@@ -3199,12 +3199,12 @@ if (isSomeString!S)
* $(D size_t) 0 for end of file, otherwise number of characters read
* Params:
* buf = Buffer used to store the resulting line data. buf is resized as necessary.
- * terminator = Line terminator (by default, $(D '\n')). Use $(XREF ascii, newline)
+ * terminator = Line terminator (by default, `'\n'`). Use $(XREF ascii, newline)
* for portability (unless the file was opened in text mode).
* Throws:
- * $(D StdioException) on I/O error, or $(D UnicodeException) on Unicode conversion error.
+ * `StdioException` on I/O error, or `UnicodeException` on Unicode conversion error.
* Example:
- * Reads $(D stdin) and writes it to $(D stdout).
+ * Reads `stdin` and writes it to `stdout`.
---
import std.stdio;
@@ -3256,7 +3256,7 @@ unittest
}
/*
- * Convenience function that forwards to $(D core.sys.posix.stdio.fopen)
+ * Convenience function that forwards to `core.sys.posix.stdio.fopen`
* (to $(D _wfopen) on Windows)
* with appropriately-constructed C-style strings.
*/
@@ -3291,7 +3291,7 @@ private FILE* fopen(in char[] name, in char[] mode = "r") @trusted nothrow @nogc
version (Posix)
{
/***********************************
- * Convenience function that forwards to $(D core.sys.posix.stdio.popen)
+ * Convenience function that forwards to `core.sys.posix.stdio.popen`
* with appropriately-constructed C-style strings.
*/
FILE* popen(in char[] name, in char[] mode = "r") @trusted nothrow @nogc
@@ -3304,7 +3304,7 @@ version (Posix)
}
/*
- * Convenience function that forwards to $(D core.stdc.stdio.fwrite)
+ * Convenience function that forwards to `core.stdc.stdio.fwrite`
* and throws an exception upon error
*/
private void binaryWrite(T)(FILE* f, T obj)
@@ -3314,7 +3314,7 @@ private void binaryWrite(T)(FILE* f, T obj)
}
/**
- * Iterates through the lines of a file by using $(D foreach).
+ * Iterates through the lines of a file by using `foreach`.
*
* Example:
*
@@ -3327,24 +3327,24 @@ void main()
}
}
---------
-The line terminator ($(D '\n') by default) is part of the string read (it
+The line terminator (`'\n'` by default) is part of the string read (it
could be missing in the last line of the file). Several types are
-supported for $(D line), and the behavior of $(D lines)
+supported for `line`, and the behavior of `lines`
changes accordingly:
-$(OL $(LI If $(D line) has type $(D string), $(D
-wstring), or $(D dstring), a new string of the respective type
-is allocated every read.) $(LI If $(D line) has type $(D
-char[]), $(D wchar[]), $(D dchar[]), the line's content
-will be reused (overwritten) across reads.) $(LI If $(D line)
-has type $(D immutable(ubyte)[]), the behavior is similar to
+$(OL $(LI If `line` has type `string`, $(D
+wstring), or `dstring`, a new string of the respective type
+is allocated every read.) $(LI If `line` has type $(D
+char[]), `wchar[]`, `dchar[]`, the line's content
+will be reused (overwritten) across reads.) $(LI If `line`
+has type `immutable(ubyte)[]`, the behavior is similar to
case (1), except that no UTF checking is attempted upon input.) $(LI
-If $(D line) has type $(D ubyte[]), the behavior is
+If `line` has type `ubyte[]`, the behavior is
similar to case (2), except that no UTF checking is attempted upon
input.))
In all cases, a two-symbols versions is also accepted, in which case
-the first symbol (of integral type, e.g. $(D ulong) or $(D
+the first symbol (of integral type, e.g. `ulong` or $(D
uint)) tracks the zero-based number of the current line.
Example:
@@ -3355,7 +3355,7 @@ Example:
}
----
- In case of an I/O error, an $(D StdioException) is thrown.
+ In case of an I/O error, an `StdioException` is thrown.
See_Also:
$(LREF byLine)
@@ -3371,7 +3371,7 @@ struct lines
Constructor.
Params:
f = File to read lines from.
- terminator = Line separator ($(D '\n') by default).
+ terminator = Line separator (`'\n'` by default).
*/
this(File f, dchar terminator = '\n')
{
@@ -3604,7 +3604,7 @@ unittest
}
/**
-Iterates through a file a chunk at a time by using $(D foreach).
+Iterates through a file a chunk at a time by using `foreach`.
Example:
@@ -3618,12 +3618,12 @@ void main()
}
---------
-The content of $(D buffer) is reused across calls. In the
- example above, $(D buffer.length) is 4096 for all iterations,
- except for the last one, in which case $(D buffer.length) may
+The content of `buffer` is reused across calls. In the
+ example above, `buffer.length` is 4096 for all iterations,
+ except for the last one, in which case `buffer.length` may
be less than 4096 (but always greater than zero).
- In case of an I/O error, an $(D StdioException) is thrown.
+ In case of an I/O error, an `StdioException` is thrown.
*/
auto chunks(File f, size_t size)
{
@@ -3766,7 +3766,7 @@ Initialize with a message and an error code.
: (message.ptr ? message ~ " (" ~ sysmsg ~ ")" : sysmsg));
}
-/** Convenience functions that throw an $(D StdioException). */
+/** Convenience functions that throw an `StdioException`. */
static void opCall(string msg)
{
throw new StdioException(msg);
diff --git a/std/string.d b/std/string.d
index 6abdf396629..02ad18b809c 100644
--- a/std/string.d
+++ b/std/string.d
@@ -2,7 +2,7 @@
/**
String handling functions. Note that many typical string functions are found in
-$(D std.algorithm) because all D strings are bidirectional ranges.
+`std.algorithm` because all D strings are bidirectional ranges.
$(SCRIPT inhibitQuickIndex = 1;)
@@ -56,9 +56,9 @@ $(TR $(TDNW Miscellaneous)
)
)
-Objects of types $(D _string), $(D wstring), and $(D dstring) are value types
+Objects of types $(D _string), `wstring`, and `dstring` are value types
and cannot be mutated element-by-element. For using mutation during building
-strings, use $(D char[]), $(D wchar[]), or $(D dchar[]). The $(D xxxstring)
+strings, use `char[]`, `wchar[]`, or `dchar[]`. The `xxxstring`
types are preferable because they don't exhibit undesired aliasing, thus
making code more robust.
@@ -137,7 +137,7 @@ class StringException : Exception
/++
- Returns a D-style array of $(D char) given a zero-terminated C-style string.
+ Returns a D-style array of `char` given a zero-terminated C-style string.
The returned array will retain the same type qualifiers as the input.
$(RED Important Note:) The returned array is a slice of the original buffer.
@@ -157,12 +157,12 @@ inout(char)[] fromStringz(inout(char)* cString) @system pure {
}
/++
- Returns a C-style zero-terminated string equivalent to $(D s). $(D s)
- must not contain embedded $(D '\0')'s as any C function will treat the first
- $(D '\0') that it sees as the end of the string. If $(D s.empty) is
- $(D true), then a string containing only $(D '\0') is returned.
+ Returns a C-style zero-terminated string equivalent to `s`. `s`
+ must not contain embedded `'\0'`'s as any C function will treat the first
+ `'\0'` that it sees as the end of the string. If `s.empty` is
+ `true`, then a string containing only `'\0'` is returned.
- $(RED Important Note:) When passing a $(D char*) to a C function, and the C
+ $(RED Important Note:) When passing a `char*` to a C function, and the C
function keeps it around for any reason, make sure that you keep a reference
to it in your D code. Otherwise, it may go away during a garbage collection
cycle and cause a nasty bug when the C code tries to use it.
@@ -272,10 +272,10 @@ pure nothrow unittest
alias CaseSensitive = Flag!"caseSensitive";
/++
- Returns the index of the first occurrence of $(D c) in $(D s). If $(D c)
- is not found, then $(D -1) is returned.
+ Returns the index of the first occurrence of `c` in `s`. If `c`
+ is not found, then `-1` is returned.
- $(D cs) indicates whether the comparisons are case sensitive.
+ `cs` indicates whether the comparisons are case sensitive.
+/
ptrdiff_t indexOf(Char)(in Char[] s, in dchar c,
in CaseSensitive cs = CaseSensitive.yes) @safe pure
@@ -371,14 +371,14 @@ ptrdiff_t indexOf(Char)(in Char[] s, in dchar c,
}
/++
- Returns the index of the first occurrence of $(D c) in $(D s) with respect
- to the start index $(D startIdx). If $(D c) is not found, then $(D -1) is
- returned. If $(D c) is found the value of the returned index is at least
- $(D startIdx). $(D startIdx) represents a codeunit index in $(D s). If the
- sequence starting at $(D startIdx) does not represent a well formed codepoint,
+ Returns the index of the first occurrence of `c` in `s` with respect
+ to the start index `startIdx`. If `c` is not found, then `-1` is
+ returned. If `c` is found the value of the returned index is at least
+ `startIdx`. `startIdx` represents a codeunit index in `s`. If the
+ sequence starting at `startIdx` does not represent a well formed codepoint,
then a $(XREF utf,UTFException) may be thrown.
- $(D cs) indicates whether the comparisons are case sensitive.
+ `cs` indicates whether the comparisons are case sensitive.
+/
ptrdiff_t indexOf(Char)(const(Char)[] s, in dchar c, in size_t startIdx,
in CaseSensitive cs = CaseSensitive.yes) @safe pure
@@ -437,10 +437,10 @@ ptrdiff_t indexOf(Char)(const(Char)[] s, in dchar c, in size_t startIdx,
}
/++
- Returns the index of the first occurrence of $(D sub) in $(D s). If $(D sub)
- is not found, then $(D -1) is returned.
+ Returns the index of the first occurrence of `sub` in `s`. If `sub`
+ is not found, then `-1` is returned.
- $(D cs) indicates whether the comparisons are case sensitive.
+ `cs` indicates whether the comparisons are case sensitive.
+/
ptrdiff_t indexOf(Char1, Char2)(const(Char1)[] s, const(Char2)[] sub,
in CaseSensitive cs = CaseSensitive.yes) @trusted
@@ -516,14 +516,14 @@ ptrdiff_t indexOf(Char1, Char2)(const(Char1)[] s, const(Char2)[] sub,
}
/++
- Returns the index of the first occurrence of $(D sub) in $(D s) with
- respect to the start index $(D startIdx). If $(D sub) is not found, then
- $(D -1) is returned. If $(D sub) is found the value of the returned index
- is at least $(D startIdx). $(D startIdx) represents a codeunit index in
- $(D s). If the sequence starting at $(D startIdx) does not represent a well
+ Returns the index of the first occurrence of `sub` in `s` with
+ respect to the start index `startIdx`. If `sub` is not found, then
+ `-1` is returned. If `sub` is found the value of the returned index
+ is at least `startIdx`. `startIdx` represents a codeunit index in
+ `s`. If the sequence starting at `startIdx` does not represent a well
formed codepoint, then a $(XREF utf,UTFException) may be thrown.
- $(D cs) indicates whether the comparisons are case sensitive.
+ `cs` indicates whether the comparisons are case sensitive.
+/
ptrdiff_t indexOf(Char1, Char2)(const(Char1)[] s, const(Char2)[] sub,
in size_t startIdx, in CaseSensitive cs = CaseSensitive.yes)
@@ -600,10 +600,10 @@ ptrdiff_t indexOf(Char1, Char2)(const(Char1)[] s, const(Char2)[] sub,
}
/++
- Returns the index of the last occurrence of $(D c) in $(D s). If $(D c)
- is not found, then $(D -1) is returned.
+ Returns the index of the last occurrence of `c` in `s`. If `c`
+ is not found, then `-1` is returned.
- $(D cs) indicates whether the comparisons are case sensitive.
+ `cs` indicates whether the comparisons are case sensitive.
+/
ptrdiff_t lastIndexOf(Char)(const(Char)[] s, in dchar c,
in CaseSensitive cs = CaseSensitive.yes) @safe pure
@@ -708,14 +708,14 @@ ptrdiff_t lastIndexOf(Char)(const(Char)[] s, in dchar c,
}
/++
- Returns the index of the last occurrence of $(D c) in $(D s). If $(D c) is
- not found, then $(D -1) is returned. The $(D startIdx) slices $(D s) in
- the following way $(D s[0 .. startIdx]). $(D startIdx) represents a
- codeunit index in $(D s). If the sequence ending at $(D startIdx) does not
+ Returns the index of the last occurrence of `c` in `s`. If `c` is
+ not found, then `-1` is returned. The `startIdx` slices `s` in
+ the following way $(D s[0 .. startIdx]). `startIdx` represents a
+ codeunit index in `s`. If the sequence ending at `startIdx` does not
represent a well formed codepoint, then a $(XREF utf,UTFException) may be
thrown.
- $(D cs) indicates whether the comparisons are case sensitive.
+ `cs` indicates whether the comparisons are case sensitive.
+/
ptrdiff_t lastIndexOf(Char)(const(Char)[] s, in dchar c, in size_t startIdx,
in CaseSensitive cs = CaseSensitive.yes) @safe pure
@@ -764,10 +764,10 @@ ptrdiff_t lastIndexOf(Char)(const(Char)[] s, in dchar c, in size_t startIdx,
}
/++
- Returns the index of the last occurrence of $(D sub) in $(D s). If $(D sub)
- is not found, then $(D -1) is returned.
+ Returns the index of the last occurrence of `sub` in `s`. If `sub`
+ is not found, then `-1` is returned.
- $(D cs) indicates whether the comparisons are case sensitive.
+ `cs` indicates whether the comparisons are case sensitive.
+/
ptrdiff_t lastIndexOf(Char1, Char2)(const(Char1)[] s, const(Char2)[] sub,
in CaseSensitive cs = CaseSensitive.yes) @safe pure
@@ -925,14 +925,14 @@ ptrdiff_t lastIndexOf(Char1, Char2)(const(Char1)[] s, const(Char2)[] sub,
}
/++
- Returns the index of the last occurrence of $(D sub) in $(D s). If $(D sub)
- is not found, then $(D -1) is returned. The $(D startIdx) slices $(D s) in
- the following way $(D s[0 .. startIdx]). $(D startIdx) represents a
- codeunit index in $(D s). If the sequence ending at $(D startIdx) does not
+ Returns the index of the last occurrence of `sub` in `s`. If `sub`
+ is not found, then `-1` is returned. The `startIdx` slices `s` in
+ the following way $(D s[0 .. startIdx]). `startIdx` represents a
+ codeunit index in `s`. If the sequence ending at `startIdx` does not
represent a well formed codepoint, then a $(XREF utf,UTFException) may be
thrown.
- $(D cs) indicates whether the comparisons are case sensitive.
+ `cs` indicates whether the comparisons are case sensitive.
+/
ptrdiff_t lastIndexOf(Char1, Char2)(const(Char1)[] s, const(Char2)[] sub,
in size_t startIdx, in CaseSensitive cs = CaseSensitive.yes) @safe pure
@@ -1115,8 +1115,8 @@ private ptrdiff_t indexOfAnyNeitherImpl(bool forward, bool any, Char, Char2)(
/**
Returns the index of the first occurence of any of the elements in $(D
- needles) in $(D haystack). If no element of $(D needles) is found,
- then $(D -1) is returned.
+ needles) in `haystack`. If no element of `needles` is found,
+ then `-1` is returned.
Params:
haystack = String to search for needles in.
@@ -1183,10 +1183,10 @@ ptrdiff_t indexOfAny(Char,Char2)(const(Char)[] haystack, const(Char2)[] needles,
/**
Returns the index of the first occurence of any of the elements in $(D
- needles) in $(D haystack). If no element of $(D needles) is found,
- then $(D -1) is returned. The $(D startIdx) slices $(D s) in the following
- way $(D haystack[startIdx .. $]). $(D startIdx) represents a codeunit
- index in $(D haystack). If the sequence ending at $(D startIdx) does not
+ needles) in `haystack`. If no element of `needles` is found,
+ then `-1` is returned. The `startIdx` slices `s` in the following
+ way $(D haystack[startIdx .. $]). `startIdx` represents a codeunit
+ index in `haystack`. If the sequence ending at `startIdx` does not
represent a well formed codepoint, then a $(XREF utf,UTFException) may be
thrown.
@@ -1195,7 +1195,7 @@ ptrdiff_t indexOfAny(Char,Char2)(const(Char)[] haystack, const(Char2)[] needles,
needles = Strings to search for in haystack.
startIdx = slices haystack like this $(D haystack[startIdx .. $]). If
the startIdx is greater equal the length of haystack the functions
- returns $(D -1).
+ returns `-1`.
cs = Indicates whether the comparisons are case sensitive.
*/
ptrdiff_t indexOfAny(Char,Char2)(const(Char)[] haystack, const(Char2)[] needles,
@@ -1276,8 +1276,8 @@ ptrdiff_t indexOfAny(Char,Char2)(const(Char)[] haystack, const(Char2)[] needles,
/**
Returns the index of the last occurence of any of the elements in $(D
- needles) in $(D haystack). If no element of $(D needles) is found,
- then $(D -1) is returned.
+ needles) in `haystack`. If no element of `needles` is found,
+ then `-1` is returned.
Params:
haystack = String to search for needles in.
@@ -1358,10 +1358,10 @@ ptrdiff_t lastIndexOfAny(Char,Char2)(const(Char)[] haystack,
/**
Returns the index of the last occurence of any of the elements in $(D
- needles) in $(D haystack). If no element of $(D needles) is found,
- then $(D -1) is returned. The $(D stopIdx) slices $(D s) in the following
- way $(D s[0 .. stopIdx]). $(D stopIdx) represents a codeunit index in
- $(D s). If the sequence ending at $(D startIdx) does not represent a well
+ needles) in `haystack`. If no element of `needles` is found,
+ then `-1` is returned. The `stopIdx` slices `s` in the following
+ way $(D s[0 .. stopIdx]). `stopIdx` represents a codeunit index in
+ `s`. If the sequence ending at `startIdx` does not represent a well
formed codepoint, then a $(XREF utf,UTFException) may be thrown.
Params:
@@ -1369,7 +1369,7 @@ ptrdiff_t lastIndexOfAny(Char,Char2)(const(Char)[] haystack,
needles = Strings to search for in haystack.
stopIdx = slices haystack like this $(D haystack[0 .. stopIdx]). If
the stopIdx is greater equal the length of haystack the functions
- returns $(D -1).
+ returns `-1`.
cs = Indicates whether the comparisons are case sensitive.
*/
ptrdiff_t lastIndexOfAny(Char,Char2)(const(Char)[] haystack,
@@ -1453,8 +1453,8 @@ ptrdiff_t lastIndexOfAny(Char,Char2)(const(Char)[] haystack,
/**
Returns the index of the first occurence of any character not an elements
- in $(D needles) in $(D haystack). If all element of $(D haystack) are
- element of $(D needles) $(D -1) is returned.
+ in `needles` in `haystack`. If all element of `haystack` are
+ element of `needles` `-1` is returned.
Params:
haystack = String to search for needles in.
@@ -1525,15 +1525,15 @@ ptrdiff_t indexOfNeither(Char,Char2)(const(Char)[] haystack,
/**
Returns the index of the first occurence of any character not an elements
- in $(D needles) in $(D haystack). If all element of $(D haystack) are
- element of $(D needles) $(D -1) is returned.
+ in `needles` in `haystack`. If all element of `haystack` are
+ element of `needles` `-1` is returned.
Params:
haystack = String to search for needles in.
needles = Strings to search for in haystack.
startIdx = slices haystack like this $(D haystack[startIdx .. $]). If
the startIdx is greater equal the length of haystack the functions
- returns $(D -1).
+ returns `-1`.
cs = Indicates whether the comparisons are case sensitive.
*/
ptrdiff_t indexOfNeither(Char,Char2)(const(Char)[] haystack,
@@ -1609,8 +1609,8 @@ ptrdiff_t indexOfNeither(Char,Char2)(const(Char)[] haystack,
/**
Returns the last index of the first occurence of any character that is not
- an elements in $(D needles) in $(D haystack). If all element of
- $(D haystack) are element of $(D needles) $(D -1) is returned.
+ an elements in `needles` in `haystack`. If all element of
+ `haystack` are element of `needles` `-1` is returned.
Params:
haystack = String to search for needles in.
@@ -1681,15 +1681,15 @@ ptrdiff_t lastIndexOfNeither(Char,Char2)(const(Char)[] haystack,
/**
Returns the last index of the first occurence of any character that is not
- an elements in $(D needles) in $(D haystack). If all element of
- $(D haystack) are element of $(D needles) $(D -1) is returned.
+ an elements in `needles` in `haystack`. If all element of
+ `haystack` are element of `needles` `-1` is returned.
Params:
haystack = String to search for needles in.
needles = Strings to search for in haystack.
stopIdx = slices haystack like this $(D haystack[0 .. stopIdx]) If
the stopIdx is greater equal the length of haystack the functions
- returns $(D -1).
+ returns `-1`.
cs = Indicates whether the comparisons are case sensitive.
*/
ptrdiff_t lastIndexOfNeither(Char,Char2)(const(Char)[] haystack,
@@ -1762,8 +1762,8 @@ ptrdiff_t lastIndexOfNeither(Char,Char2)(const(Char)[] haystack,
/**
* Returns the representation of a string, which has the same type
- * as the string except the character type is replaced by $(D ubyte),
- * $(D ushort), or $(D uint) depending on the character width.
+ * as the string except the character type is replaced by `ubyte`,
+ * `ushort`, or `uint` depending on the character width.
*/
auto representation(Char)(Char[] s) @safe pure nothrow @nogc
if (isSomeChar!Char)
@@ -1813,7 +1813,7 @@ auto representation(Char)(Char[] s) @safe pure nothrow @nogc
/++
- Capitalize the first character of $(D s) and convert the rest of $(D s)
+ Capitalize the first character of `s` and convert the rest of `s`
to lowercase.
+/
S capitalize(S)(S s) @trusted pure
@@ -1893,9 +1893,9 @@ S capitalize(S)(S s) @trusted pure
}
/++
- Split $(D s) into an array of lines using $(D '\r'), $(D '\n'),
- $(D "\r\n"), $(XREF uni, lineSep), and $(XREF uni, paraSep) as delimiters.
- If $(D keepTerm) is set to $(D KeepTerminator.yes), then the delimiter
+ Split `s` into an array of lines using `'\r'`, `'\n'`,
+ `"\r\n"`, $(XREF uni, lineSep), and $(XREF uni, paraSep) as delimiters.
+ If `keepTerm` is set to `KeepTerminator.yes`, then the delimiter
is included in the strings returned.
+/
alias KeepTerminator = Flag!"keepTerminator";
@@ -1995,9 +1995,9 @@ S[] splitLines(S)(S s, in KeepTerminator keepTerm = KeepTerminator.no) @safe pur
/++
Strips leading whitespace (as defined by $(XREF uni, isWhite)).
- Returns: $(D str) stripped of leading whitespace.
+ Returns: `str` stripped of leading whitespace.
- Postconditions: $(D str) and the returned value
+ Postconditions: `str` and the returned value
will share the same tail (see $(XREF array, sameTail)).
+/
C[] stripLeft(C)(C[] str) @safe pure @nogc
@@ -2032,9 +2032,9 @@ C[] stripLeft(C)(C[] str) @safe pure @nogc
/++
Strips trailing whitespace (as defined by $(XREF uni, isWhite)).
- Returns: $(D str) stripped of trailing whitespace.
+ Returns: `str` stripped of trailing whitespace.
- Postconditions: $(D str) and the returned value
+ Postconditions: `str` and the returned value
will share the same head (see $(XREF array, sameHead)).
+/
C[] stripRight(C)(C[] str) @safe pure @nogc
@@ -2071,7 +2071,7 @@ C[] stripRight(C)(C[] str) @safe pure @nogc
Strips both leading and trailing whitespace (as defined by
$(XREF uni, isWhite)).
- Returns: $(D str) stripped of trailing whitespace.
+ Returns: `str` stripped of trailing whitespace.
+/
C[] strip(C)(C[] str) @safe pure
if (isSomeChar!C)
@@ -2146,13 +2146,13 @@ C[] strip(C)(C[] str) @safe pure
/++
- If $(D str) ends with $(D delimiter), then $(D str) is returned without
- $(D delimiter) on its end. If it $(D str) does $(I not) end with
- $(D delimiter), then it is returned unchanged.
+ If `str` ends with `delimiter`, then `str` is returned without
+ `delimiter` on its end. If it `str` does $(I not) end with
+ `delimiter`, then it is returned unchanged.
- If no $(D delimiter) is given, then one trailing $(D '\r'), $(D '\n'),
- $(D "\r\n"), $(XREF uni, lineSep), or $(XREF uni, paraSep) is removed from
- the end of $(D str). If $(D str) does not end with any of those characters,
+ If no `delimiter` is given, then one trailing `'\r'`, `'\n'`,
+ `"\r\n"`, $(XREF uni, lineSep), or $(XREF uni, paraSep) is removed from
+ the end of `str`. If `str` does not end with any of those characters,
then it is returned unchanged.
+/
C[] chomp(C)(C[] str) @safe pure nothrow @nogc
@@ -2295,9 +2295,9 @@ unittest
/++
- If $(D str) starts with $(D delimiter), then the part of $(D str) following
- $(D delimiter) is returned. If it $(D str) does $(I not) start with
- $(D delimiter), then it is returned unchanged.
+ If `str` starts with `delimiter`, then the part of `str` following
+ `delimiter` is returned. If it `str` does $(I not) start with
+ `delimiter`, then it is returned unchanged.
+/
C1[] chompPrefix(C1, C2)(C1[] str, C2[] delimiter) @safe pure
if (isSomeChar!C1 && isSomeChar!C2)
@@ -2358,8 +2358,8 @@ C1[] chompPrefix(C1, C2)(C1[] str, C2[] delimiter) @safe pure
/++
- Returns $(D str) without its last character, if there is one. If $(D str)
- ends with $(D "\r\n"), then both are removed. If $(D str) is empty, then
+ Returns `str` without its last character, if there is one. If `str`
+ ends with `"\r\n"`, then both are removed. If `str` is empty, then
then it is returned unchanged.
+/
S chop(S)(S str) @safe pure
@@ -2413,9 +2413,9 @@ unittest
/++
- Left justify $(D s) in a field $(D width) characters wide. $(D fillChar)
+ Left justify `s` in a field `width` characters wide. `fillChar`
is the character that will be used to fill up the space in the field that
- $(D s) doesn't fill.
+ `s` doesn't fill.
+/
S leftJustify(S)(S s, size_t width, dchar fillChar = ' ') @trusted pure
if (isSomeString!S)
@@ -2451,9 +2451,9 @@ S leftJustify(S)(S s, size_t width, dchar fillChar = ' ') @trusted pure
/++
- Right justify $(D s) in a field $(D width) characters wide. $(D fillChar)
+ Right justify `s` in a field `width` characters wide. `fillChar`
is the character that will be used to fill up the space in the field that
- $(D s) doesn't fill.
+ `s` doesn't fill.
+/
S rightJustify(S)(S s, size_t width, dchar fillChar = ' ') @trusted pure
if (isSomeString!S)
@@ -2489,9 +2489,9 @@ S rightJustify(S)(S s, size_t width, dchar fillChar = ' ') @trusted pure
/++
- Center $(D s) in a field $(D width) characters wide. $(D fillChar)
+ Center `s` in a field `width` characters wide. `fillChar`
is the character that will be used to fill up the space in the field that
- $(D s) doesn't fill.
+ `s` doesn't fill.
+/
S center(S)(S s, size_t width, dchar fillChar = ' ') @trusted pure
if (isSomeString!S)
@@ -2567,8 +2567,8 @@ S center(S)(S s, size_t width, dchar fillChar = ' ') @trusted pure
/++
- Replace each tab character in $(D s) with the number of spaces necessary
- to align the following character at the next tab stop where $(D tabSize)
+ Replace each tab character in `s` with the number of spaces necessary
+ to align the following character at the next tab stop where `tabSize`
is the distance between tab stops.
+/
S detab(S)(S s, size_t tabSize = 8) @trusted pure
@@ -2657,12 +2657,12 @@ S detab(S)(S s, size_t tabSize = 8) @trusted pure
}
/++
- Replaces spaces in $(D s) with the optimal number of tabs.
+ Replaces spaces in `s` with the optimal number of tabs.
All spaces and tabs at the end of a line are removed.
Params:
s = String to convert.
- tabSize = Tab columns are $(D tabSize) spaces apart.
+ tabSize = Tab columns are `tabSize` spaces apart.
+/
S entab(S)(S s, size_t tabSize = 8) @trusted pure
if (isSomeString!S)
@@ -2808,11 +2808,11 @@ S entab(S)(S s, size_t tabSize = 8) @trusted pure
/++
- Replaces the characters in $(D str) which are keys in $(D transTable) with
- their corresponding values in $(D transTable). $(D transTable) is an AA
- where its keys are $(D dchar) and its values are either $(D dchar) or some
- type of string. Also, if $(D toRemove) is given, the characters in it are
- removed from $(D str) prior to translation. $(D str) itself is unaltered.
+ Replaces the characters in `str` which are keys in `transTable` with
+ their corresponding values in `transTable`. `transTable` is an AA
+ where its keys are `dchar` and its values are either `dchar` or some
+ type of string. Also, if `toRemove` is given, the characters in it are
+ removed from `str` prior to translation. `str` itself is unaltered.
A copy with the changes is returned.
See_Also:
@@ -2971,7 +2971,7 @@ C1[] translate(C1, S, C2 = immutable char)(C1[] str,
}
/++
- This is an overload of $(D translate) which takes an existing buffer to write the contents to.
+ This is an overload of `translate` which takes an existing buffer to write the contents to.
Params:
str = The original string.
@@ -3066,22 +3066,22 @@ private void translateImpl(C1, T, C2, Buffer)(C1[] str,
cases where Unicode processing is not necessary.
Unlike the other overloads of $(LREF _translate), this one does not take
- an AA. Rather, it takes a $(D string) generated by $(LREF makeTrans).
+ an AA. Rather, it takes a `string` generated by $(LREF makeTrans).
- The array generated by $(D makeTrans) is $(D 256) elements long such that
+ The array generated by `makeTrans` is `256` elements long such that
the index is equal to the ASCII character being replaced and the value is
equal to the character that it's being replaced with. Note that translate
does not decode any of the characters, so you can actually pass it Extended
- ASCII characters if you want to (ASCII only actually uses $(D 128)
+ ASCII characters if you want to (ASCII only actually uses `128`
characters), but be warned that Extended ASCII characters are not valid
- Unicode and therefore will result in a $(D UTFException) being thrown from
+ Unicode and therefore will result in a `UTFException` being thrown from
most other Phobos functions.
Also, because no decoding occurs, it is possible to use this overload to
translate ASCII characters within a proper UTF-8 string without altering the
other, non-ASCII characters. It's replacing any code unit greater than
- $(D 127) with another code unit or replacing any code unit with another code
- unit greater than $(D 127) which will cause UTF validation issues.
+ `127` with another code unit or replacing any code unit with another code
+ unit greater than `127` which will cause UTF validation issues.
See_Also:
$(LREF tr)
@@ -3197,7 +3197,7 @@ body
}
/++
- This is an $(I $(RED ASCII-only)) overload of $(D translate) which takes an existing buffer to write the contents to.
+ This is an $(I $(RED ASCII-only)) overload of `translate` which takes an existing buffer to write the contents to.
Params:
str = The original string.
@@ -3642,10 +3642,10 @@ S succ(S)(S s) @safe pure if (isSomeString!S)
/++
- Replaces the characters in $(D str) which are in $(D from) with the
- the corresponding characters in $(D to) and returns the resulting string.
+ Replaces the characters in `str` which are in `from` with the
+ the corresponding characters in `to` and returns the resulting string.
- $(D tr) is based on
+ `tr` is based on
$(WEB pubs.opengroup.org/onlinepubs/9699919799/utilities/_tr.html, Posix's tr),
though it doesn't do everything that the Posix utility does.
@@ -3658,26 +3658,26 @@ S succ(S)(S s) @safe pure if (isSomeString!S)
Modifiers:
$(BOOKTABLE,
$(TR $(TD Modifier) $(TD Description))
- $(TR $(TD $(D 'c')) $(TD Complement the list of characters in $(D from)))
- $(TR $(TD $(D 'd')) $(TD Removes matching characters with no corresponding
- replacement in $(D to)))
- $(TR $(TD $(D 's')) $(TD Removes adjacent duplicates in the replaced
+ $(TR $(TD `'c'`) $(TD Complement the list of characters in `from`))
+ $(TR $(TD `'d'`) $(TD Removes matching characters with no corresponding
+ replacement in `to`))
+ $(TR $(TD `'s'`) $(TD Removes adjacent duplicates in the replaced
characters))
)
- If the modifier $(D 'd') is present, then the number of characters in
- $(D to) may be only $(D 0) or $(D 1).
+ If the modifier `'d'` is present, then the number of characters in
+ `to` may be only `0` or `1`.
- If the modifier $(D 'd') is $(I not) present, and $(D to) is empty, then
- $(D to) is taken to be the same as $(D from).
+ If the modifier `'d'` is $(I not) present, and `to` is empty, then
+ `to` is taken to be the same as `from`.
- If the modifier $(D 'd') is $(I not) present, and $(D to) is shorter than
- $(D from), then $(D to) is extended by replicating the last character in
- $(D to).
+ If the modifier `'d'` is $(I not) present, and `to` is shorter than
+ `from`, then `to` is extended by replicating the last character in
+ `to`.
- Both $(D from) and $(D to) may contain ranges using the $(D '-') character
- (e.g. $(D "a-d") is synonymous with $(D "abcd").) Neither accept a leading
- $(D '^') as meaning the complement of the string (use the $(D 'c') modifier
+ Both `from` and `to` may contain ranges using the `'-'` character
+ (e.g. `"a-d"` is synonymous with `"abcd"`.) Neither accept a leading
+ `'^'` as meaning the complement of the string (use the `'c'` modifier
for that).
+/
C1[] tr(C1, C2, C3, C4 = immutable char)
@@ -3876,7 +3876,7 @@ unittest
*
* [in] bool bAllowSep
* False by default, but when set to true it will accept the
- * separator characters $(D ',') and $(D '__') within the string, but these
+ * separator characters `','` and $(D '__') within the string, but these
* characters should be stripped from the string before using any
* of the conversion functions like toInt(), toFloat(), and etc
* else an error will occur.
@@ -4704,11 +4704,11 @@ void main() {
});
}
-/** Assume the given array of integers $(D arr) is a well-formed UTF string and
+/** Assume the given array of integers `arr` is a well-formed UTF string and
return it typed as a UTF string.
-$(D ubyte) becomes $(D char), $(D ushort) becomes $(D wchar) and $(D uint)
-becomes $(D dchar). Type qualifiers are preserved.
+`ubyte` becomes `char`, `ushort` becomes `wchar` and `uint`
+becomes `dchar`. Type qualifiers are preserved.
See_Also: $(LREF representation)
*/
diff --git a/std/system.d b/std/system.d
index d4b47fe87ab..d8b167257d0 100644
--- a/std/system.d
+++ b/std/system.d
@@ -21,8 +21,8 @@ immutable
Note:
This is for cases where you need a value representing the OS at
runtime. If you're doing something which should compile differently
- on different OSes, then please use $(D version(Windows)),
- $(D version(linux)), etc.
+ on different OSes, then please use `version(Windows)`,
+ `version(linux)`, etc.
See_Also:
Predefined Versions
@@ -56,8 +56,8 @@ immutable
This is intended for cases where you need to deal with endianness at
runtime. If you're doing something which should compile differently
depending on whether you're compiling on a big endian or little
- endian machine, then please use $(D version(BigEndian)) and
- $(D version(LittleEndian)).
+ endian machine, then please use `version(BigEndian)` and
+ `version(LittleEndian)`.
See_Also:
Predefined Versions
diff --git a/std/traits.d b/std/traits.d
index 7f85f752a0c..09053da4811 100644
--- a/std/traits.d
+++ b/std/traits.d
@@ -134,7 +134,7 @@
* Copyright: Copyright Digital Mars 2005 - 2009.
* License: $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
* Authors: $(WEB digitalmars.com, Walter Bright),
- * Tomasz Stachowiak ($(D isExpressionTuple)),
+ * Tomasz Stachowiak (`isExpressionTuple`),
* $(WEB erdani.org, Andrei Alexandrescu),
* Shin Fujishiro,
* $(WEB octarineparrot.com, Robert Clipsham),
@@ -804,7 +804,7 @@ unittest
* Get the type of the return value from a function,
* a pointer to function, a delegate, a struct
* with an opCall, a pointer to a struct with an opCall,
- * or a class with an $(D opCall). Please note that $(D_KEYWORD ref)
+ * or a class with an `opCall`. Please note that $(D_KEYWORD ref)
* is not part of a type, but the attribute of the function
* (see template $(LREF functionAttributes)).
* Example:
@@ -863,8 +863,8 @@ unittest
/***
Get, as a tuple, the types of the parameters to a function, a pointer
-to function, a delegate, a struct with an $(D opCall), a pointer to a
-struct with an $(D opCall), or a class with an $(D opCall).
+to function, a delegate, a struct with an `opCall`, a pointer to a
+struct with an `opCall`, or a class with an `opCall`.
Example:
---
@@ -908,7 +908,7 @@ unittest
}
/**
-Returns the number of arguments of function $(D func).
+Returns the number of arguments of function `func`.
arity is undefined for variadic functions.
Example:
@@ -936,7 +936,7 @@ unittest {
/**
Returns a tuple consisting of the storage classes of the parameters of a
-function $(D func).
+function `func`.
Example:
--------------------
@@ -1134,7 +1134,7 @@ unittest
/**
Get, as a tuple, the default value of the parameters to a function symbol.
-If a parameter doesn't have the default value, $(D void) is returned instead.
+If a parameter doesn't have the default value, `void` is returned instead.
*/
template ParameterDefaultValueTuple(func...)
if (func.length == 1 && isCallable!func)
@@ -1228,7 +1228,7 @@ unittest
/**
-Returns the attributes attached to a function $(D func).
+Returns the attributes attached to a function `func`.
*/
enum FunctionAttribute : uint
{
@@ -1416,7 +1416,7 @@ private FunctionAttribute extractAttribFlags(Attribs...)()
/**
-$(D true) if $(D func) is $(D @safe) or $(D @trusted).
+`true` if `func` is `@safe` or `@trusted`.
Example:
--------------------
@@ -1506,7 +1506,7 @@ unittest
/**
-$(D true) if $(D func) is $(D @system).
+`true` if `func` is `@system`.
Example:
--------------------
@@ -1598,7 +1598,7 @@ also badly broken prior to 2.060 (bug# 8362), so any code which uses it
probably needs to be changed anyway. Please use $(D allSatisfy(isSafe, ...))
instead. This will be removed in June 2015.)
-$(D true) all functions are $(D isSafe).
+`true` all functions are `isSafe`.
Example:
--------------------
@@ -1763,11 +1763,11 @@ unittest
/**
-Get the function type from a callable object $(D func).
+Get the function type from a callable object `func`.
-Using builtin $(D typeof) on a property function yields the types of the
+Using builtin `typeof` on a property function yields the types of the
property value, not of the property function itself. Still,
-$(D FunctionTypeOf) is able to obtain function types of properties.
+`FunctionTypeOf` is able to obtain function types of properties.
--------------------
class C
{
@@ -2032,8 +2032,8 @@ unittest
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
/**
-Determines whether $(D T) has its own context pointer.
-$(D T) must be either $(D class), $(D struct), or $(D union).
+Determines whether `T` has its own context pointer.
+`T` must be either `class`, `struct`, or `union`.
*/
template isNested(T)
if(is(T == class) || is(T == struct) || is(T == union))
@@ -2053,7 +2053,7 @@ unittest
}
/**
-Determines whether $(D T) or any of its representation types
+Determines whether `T` or any of its representation types
have a context pointer.
*/
template hasNested(T)
@@ -2136,8 +2136,8 @@ unittest
* This consists of the fields that take up memory space,
* excluding the hidden fields like the virtual function
* table pointer or a context pointer for nested types.
- * If $(D T) isn't a struct, class, or union returns typetuple
- * with one element $(D T).
+ * If `T` isn't a struct, class, or union returns typetuple
+ * with one element `T`.
*/
template FieldTypeTuple(T)
{
@@ -2186,7 +2186,7 @@ private enum NameOf(alias T) = T.stringof;
* Get as an expression tuple the names of the fields of a struct, class, or
* union. This consists of the fields that take up memory space, excluding the
* hidden fields like the virtual function table pointer or a context pointer
- * for nested types. If $(D T) isn't a struct, class, or union returns an
+ * for nested types. If `T` isn't a struct, class, or union returns an
* expression tuple with an empty string.
*/
template FieldNameTuple(T)
@@ -2453,7 +2453,7 @@ RepresentationOffsets
// }
/*
-Statically evaluates to $(D true) if and only if $(D T)'s
+Statically evaluates to `true` if and only if `T`'s
representation contains at least one field of pointer or array type.
Members of class types are not considered raw pointers. Pointers to
immutable objects are not considered raw aliasing.
@@ -2563,7 +2563,7 @@ unittest
}
/*
-Statically evaluates to $(D true) if and only if $(D T)'s
+Statically evaluates to `true` if and only if `T`'s
representation contains at least one non-shared field of pointer or
array type. Members of class types are not considered raw pointers.
Pointers to immutable objects are not considered raw aliasing.
@@ -2760,7 +2760,7 @@ unittest
}
/*
-Statically evaluates to $(D true) if and only if $(D T)'s
+Statically evaluates to `true` if and only if `T`'s
representation includes at least one non-immutable object reference.
*/
@@ -2783,7 +2783,7 @@ private template hasObjects(T...)
}
/*
-Statically evaluates to $(D true) if and only if $(D T)'s
+Statically evaluates to `true` if and only if `T`'s
representation includes at least one non-immutable non-shared object
reference.
*/
@@ -2807,10 +2807,10 @@ private template hasUnsharedObjects(T...)
}
/**
-Returns $(D true) if and only if $(D T)'s representation includes at
-least one of the following: $(OL $(LI a raw pointer $(D U*) and $(D U)
-is not immutable;) $(LI an array $(D U[]) and $(D U) is not
-immutable;) $(LI a reference to a class or interface type $(D C) and $(D C) is
+Returns `true` if and only if `T`'s representation includes at
+least one of the following: $(OL $(LI a raw pointer `U*` and `U`
+is not immutable;) $(LI an array `U[]` and `U` is not
+immutable;) $(LI a reference to a class or interface type `C` and `C` is
not immutable.) $(LI an associative array that is not immutable.)
$(LI a delegate.))
*/
@@ -2909,9 +2909,9 @@ unittest
static assert(!hasAliasing!S14);
}
/**
-Returns $(D true) if and only if $(D T)'s representation includes at
-least one of the following: $(OL $(LI a raw pointer $(D U*);) $(LI an
-array $(D U[]);) $(LI a reference to a class type $(D C).)
+Returns `true` if and only if `T`'s representation includes at
+least one of the following: $(OL $(LI a raw pointer `U*`;) $(LI an
+array `U[]`;) $(LI a reference to a class type `C`.)
$(LI an associative array.) $(LI a delegate.))
*/
template hasIndirections(T)
@@ -3012,11 +3012,11 @@ unittest //12000
}
/**
-Returns $(D true) if and only if $(D T)'s representation includes at
-least one of the following: $(OL $(LI a raw pointer $(D U*) and $(D U)
-is not immutable or shared;) $(LI an array $(D U[]) and $(D U) is not
-immutable or shared;) $(LI a reference to a class type $(D C) and
-$(D C) is not immutable or shared.) $(LI an associative array that is not
+Returns `true` if and only if `T`'s representation includes at
+least one of the following: $(OL $(LI a raw pointer `U*` and `U`
+is not immutable or shared;) $(LI an array `U[]` and `U` is not
+immutable or shared;) $(LI a reference to a class type `C` and
+`C` is not immutable or shared.) $(LI an associative array that is not
immutable or shared.) $(LI a delegate that is not shared.))
*/
@@ -3180,9 +3180,9 @@ unittest
}
/**
- True if $(D S) or any type embedded directly in the representation of $(D S)
+ True if `S` or any type embedded directly in the representation of `S`
defines an elaborate copy constructor. Elaborate copy constructors are
- introduced by defining $(D this(this)) for a $(D struct).
+ introduced by defining `this(this)` for a `struct`.
Classes and unions never have elaborate copy constructors.
*/
@@ -3227,12 +3227,12 @@ unittest
}
/**
- True if $(D S) or any type directly embedded in the representation of $(D S)
+ True if `S` or any type directly embedded in the representation of `S`
defines an elaborate assignment. Elaborate assignments are introduced by
defining $(D opAssign(typeof(this))) or $(D opAssign(ref typeof(this)))
- for a $(D struct) or when there is a compiler-generated $(D opAssign).
+ for a `struct` or when there is a compiler-generated `opAssign`.
- A type $(D S) gets compiler-generated $(D opAssign) in case it has
+ A type `S` gets compiler-generated `opAssign` in case it has
an elaborate copy constructor or elaborate destructor.
Classes and unions never have elaborate assignments.
@@ -3314,13 +3314,13 @@ unittest
}
/**
- True if $(D S) or any type directly embedded in the representation
- of $(D S) defines an elaborate destructor. Elaborate destructors
- are introduced by defining $(D ~this()) for a $(D
+ True if `S` or any type directly embedded in the representation
+ of `S` defines an elaborate destructor. Elaborate destructors
+ are introduced by defining `~this()` for a $(D
struct).
Classes and unions never have elaborate destructors, even
- though classes may define $(D ~this()).
+ though classes may define `~this()`.
*/
template hasElaborateDestructor(S)
{
@@ -3365,8 +3365,8 @@ unittest
alias Identity(alias A) = A;
/**
- Yields $(D true) if and only if $(D T) is an aggregate that defines
- a symbol called $(D name).
+ Yields `true` if and only if `T` is an aggregate that defines
+ a symbol called `name`.
*/
template hasMember(T, string name)
{
@@ -3432,11 +3432,11 @@ unittest
Retrieves the members of an enumerated type $(D enum E).
Params:
- E = An enumerated type. $(D E) may have duplicated values.
+ E = An enumerated type. `E` may have duplicated values.
Returns:
- Static tuple composed of the members of the enumerated type $(D E).
- The members are arranged in the same order as declared in $(D E).
+ Static tuple composed of the members of the enumerated type `E`.
+ The members are arranged in the same order as declared in `E`.
Note:
An enum can have multiple members which have the same value. If you want
@@ -3445,7 +3445,7 @@ Note:
generating duplicate switch cases.
Note:
- Returned values are strictly typed with $(D E). Thus, the following code
+ Returned values are strictly typed with `E`. Thus, the following code
does not work without the explicit cast:
--------------------
enum E : int { a, b, c }
@@ -3467,8 +3467,8 @@ auto sqrts = [ EnumMembers!Sqrts ];
assert(sqrts == [ Sqrts.one, Sqrts.two, Sqrts.three ]);
--------------------
- A generic function $(D rank(v)) in the following example uses this
- template for finding a member $(D e) in an enumerated type $(D E).
+ A generic function `rank(v)` in the following example uses this
+ template for finding a member `e` in an enumerated type `E`.
--------------------
// Returns i if e is the i-th enumerator of E.
size_t rank(E)(E e)
@@ -3822,8 +3822,8 @@ unittest
/**
-Returns a tuple of non-static functions with the name $(D name) declared in the
-class or interface $(D C). Covariant duplicates are shrunk into the most
+Returns a tuple of non-static functions with the name `name` declared in the
+class or interface `C`. Covariant duplicates are shrunk into the most
derived one.
Example:
@@ -3975,7 +3975,7 @@ unittest
/**
-Returns an alias to the template that $(D T) is an instance of.
+Returns an alias to the template that `T` is an instance of.
Example:
--------------------
@@ -4018,7 +4018,7 @@ unittest
/**
-Returns a $(D TypeTuple) of the template arguments used to instantiate $(D T).
+Returns a `TypeTuple` of the template arguments used to instantiate `T`.
Example:
--------------------
@@ -4224,7 +4224,7 @@ unittest
}
/**
-Is $(D From) implicitly convertible to $(D To)?
+Is `From` implicitly convertible to `To`?
*/
template isImplicitlyConvertible(From, To)
{
@@ -4256,12 +4256,12 @@ unittest
}
/**
-Returns $(D true) iff a value of type $(D Rhs) can be assigned to a variable of
-type $(D Lhs).
+Returns `true` iff a value of type `Rhs` can be assigned to a variable of
+type `Lhs`.
-$(D isAssignable) returns whether both an lvalue and rvalue can be assigned.
+`isAssignable` returns whether both an lvalue and rvalue can be assigned.
-If you omit $(D Rhs), $(D isAssignable) will check identity assignable of $(D Lhs).
+If you omit `Rhs`, `isAssignable` will check identity assignable of `Lhs`.
*/
enum isAssignable(Lhs, Rhs = Lhs) = isRvalueAssignable!(Lhs, Rhs) && isLvalueAssignable!(Lhs, Rhs);
@@ -4446,7 +4446,7 @@ unittest
/*
-Works like $(D isImplicitlyConvertible), except this cares only about storage
+Works like `isImplicitlyConvertible`, except this cares only about storage
classes of the arguments.
*/
private template isStorageClassImplicitlyConvertible(From, To)
@@ -4471,8 +4471,8 @@ unittest
/**
-Determines whether the function type $(D F) is covariant with $(D G), i.e.,
-functions of the type $(D F) can override ones of the type $(D G).
+Determines whether the function type `F` is covariant with `G`, i.e.,
+functions of the type `F` can override ones of the type `G`.
Example:
--------------------
@@ -4668,7 +4668,7 @@ unittest
private struct __InoutWorkaroundStruct{}
/**
-Creates an lvalue or rvalue of type $(D T) for $(D typeof(...)) and
+Creates an lvalue or rvalue of type `T` for `typeof(...)` and
$(D __traits(compiles, ...)) purposes. No actual value is returned.
Note: Trying to use returned value will result in a
@@ -5137,7 +5137,7 @@ template BuiltinTypeOf(T)
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
/**
- * Detect whether $(D T) is a built-in boolean type.
+ * Detect whether `T` is a built-in boolean type.
*/
enum bool isBoolean(T) = is(BooleanTypeOf!T) && !isAggregateType!T;
@@ -5150,8 +5150,8 @@ unittest
}
/**
- * Detect whether $(D T) is a built-in integral type. Types $(D bool),
- * $(D char), $(D wchar), and $(D dchar) are not considered integral.
+ * Detect whether `T` is a built-in integral type. Types `bool`,
+ * `char`, `wchar`, and `dchar` are not considered integral.
*/
enum bool isIntegral(T) = is(IntegralTypeOf!T) && !isAggregateType!T;
@@ -5175,7 +5175,7 @@ unittest
}
/**
- * Detect whether $(D T) is a built-in floating point type.
+ * Detect whether `T` is a built-in floating point type.
*/
enum bool isFloatingPoint(T) = is(FloatingPointTypeOf!T) && !isAggregateType!T;
@@ -5201,7 +5201,7 @@ unittest
}
/**
-Detect whether $(D T) is a built-in numeric type (integral or floating
+Detect whether `T` is a built-in numeric type (integral or floating
point).
*/
enum bool isNumeric(T) = is(NumericTypeOf!T) && !isAggregateType!T;
@@ -5219,7 +5219,7 @@ unittest
}
/**
-Detect whether $(D T) is a scalar type (a built-in numeric, character or boolean type).
+Detect whether `T` is a scalar type (a built-in numeric, character or boolean type).
*/
enum bool isScalarType(T) = isNumeric!T || isSomeChar!T || isBoolean!T;
@@ -5233,7 +5233,7 @@ unittest
}
/**
-Detect whether $(D T) is a basic type (scalar type or void).
+Detect whether `T` is a basic type (scalar type or void).
*/
enum bool isBasicType(T) = isScalarType!T || is(T == void);
@@ -5247,7 +5247,7 @@ unittest
}
/**
-Detect whether $(D T) is a built-in unsigned numeric type.
+Detect whether `T` is a built-in unsigned numeric type.
*/
enum bool isUnsigned(T) = is(UnsignedTypeOf!T) && !isAggregateType!T;
@@ -5264,7 +5264,7 @@ unittest
}
/**
-Detect whether $(D T) is a built-in signed numeric type.
+Detect whether `T` is a built-in signed numeric type.
*/
enum bool isSigned(T) = is(SignedTypeOf!T) && !isAggregateType!T;
@@ -5281,7 +5281,7 @@ unittest
}
/**
-Detect whether $(D T) is one of the built-in character types.
+Detect whether `T` is one of the built-in character types.
*/
enum bool isSomeChar(T) = is(CharTypeOf!T) && !isAggregateType!T;
@@ -5307,12 +5307,12 @@ unittest
}
/**
-Detect whether $(D T) is one of the built-in string types.
+Detect whether `T` is one of the built-in string types.
-The built-in string types are $(D Char[]), where $(D Char) is any of $(D char),
-$(D wchar) or $(D dchar), with or without qualifiers.
+The built-in string types are `Char[]`, where `Char` is any of `char`,
+`wchar` or `dchar`, with or without qualifiers.
-Static arrays of characters (like $(D char[80])) are not considered
+Static arrays of characters (like `char[80]`) are not considered
built-in string types.
*/
enum bool isSomeString(T) = is(StringTypeOf!T) && !isAggregateType!T && !isStaticArray!T;
@@ -5359,7 +5359,7 @@ unittest
}
/**
- * Detect whether type $(D T) is a static array.
+ * Detect whether type `T` is a static array.
*/
enum bool isStaticArray(T) = is(StaticArrayTypeOf!T) && !isAggregateType!T;
@@ -5390,7 +5390,7 @@ unittest
}
/**
- * Detect whether type $(D T) is a dynamic array.
+ * Detect whether type `T` is a dynamic array.
*/
enum bool isDynamicArray(T) = is(DynamicArrayTypeOf!T) && !isAggregateType!T;
@@ -5413,7 +5413,7 @@ unittest
}
/**
- * Detect whether type $(D T) is an array (static or dynamic; for associative
+ * Detect whether type `T` is an array (static or dynamic; for associative
* arrays see $(LREF isAssociativeArray)).
*/
enum bool isArray(T) = isStaticArray!T || isDynamicArray!T;
@@ -5435,7 +5435,7 @@ unittest
}
/**
- * Detect whether $(D T) is an associative array type
+ * Detect whether `T` is an associative array type
*/
enum bool isAssociativeArray(T) = is(AssocArrayTypeOf!T) && !isAggregateType!T;
@@ -5466,12 +5466,12 @@ unittest
}
/**
- * Detect whether type $(D T) is a builtin type.
+ * Detect whether type `T` is a builtin type.
*/
enum bool isBuiltinType(T) = is(BuiltinTypeOf!T) && !isAggregateType!T;
/**
- * Detect whether type $(D T) is a SIMD vector type.
+ * Detect whether type `T` is a SIMD vector type.
*/
enum bool isSIMDVector(T) = is(T : __vector(V[N]), V, size_t N);
@@ -5488,7 +5488,7 @@ unittest
}
/**
- * Detect whether type $(D T) is a pointer.
+ * Detect whether type `T` is a pointer.
*/
enum bool isPointer(T) = is(T == U*, U) && !isAggregateType!T;
@@ -5530,16 +5530,16 @@ unittest
}
/**
- * Detect whether type $(D T) is an aggregate type.
+ * Detect whether type `T` is an aggregate type.
*/
enum bool isAggregateType(T) = is(T == struct) || is(T == union) ||
is(T == class) || is(T == interface);
/**
- * Returns $(D true) if T can be iterated over using a $(D foreach) loop with
+ * Returns `true` if T can be iterated over using a `foreach` loop with
* a single loop variable of automatically inferred type, regardless of how
- * the $(D foreach) loop is implemented. This includes ranges, structs/classes
- * that define $(D opApply) with a single loop variable, and builtin dynamic,
+ * the `foreach` loop is implemented. This includes ranges, structs/classes
+ * that define `opApply` with a single loop variable, and builtin dynamic,
* static and associative arrays.
*/
enum bool isIterable(T) = is(typeof({ foreach(elem; T.init) {} }));
@@ -5653,7 +5653,7 @@ unittest
/**
- * Check whether the tuple $(D T) is a type tuple.
+ * Check whether the tuple `T` is a type tuple.
* A type tuple only contains types.
*
* See_Also: $(LREF isExpressionTuple).
@@ -5696,7 +5696,7 @@ unittest
/**
-Detect whether symbol or type $(D T) is a function pointer.
+Detect whether symbol or type `T` is a function pointer.
*/
template isFunctionPointer(T...)
if (T.length == 1)
@@ -5731,7 +5731,7 @@ unittest
}
/**
-Detect whether symbol or type $(D T) is a delegate.
+Detect whether symbol or type `T` is a delegate.
*/
template isDelegate(T...)
if (T.length == 1)
@@ -5768,7 +5768,7 @@ unittest
}
/**
-Detect whether symbol or type $(D T) is a function, a function pointer or a delegate.
+Detect whether symbol or type `T` is a function, a function pointer or a delegate.
*/
template isSomeFunction(T...)
if (T.length == 1)
@@ -5828,7 +5828,7 @@ unittest
/**
-Detect whether $(D T) is a callable object, which can be called with the
+Detect whether `T` is a callable object, which can be called with the
function call operator $(D $(LPAREN)...$(RPAREN)).
*/
template isCallable(T...)
@@ -5862,7 +5862,7 @@ unittest
/**
- * Detect whether $(D T) is a an abstract function.
+ * Detect whether `T` is a an abstract function.
*/
template isAbstractFunction(T...)
if (T.length == 1)
@@ -5881,7 +5881,7 @@ unittest
}
/**
- * Detect whether $(D T) is a a final function.
+ * Detect whether `T` is a a final function.
*/
template isFinalFunction(T...)
if (T.length == 1)
@@ -5905,7 +5905,7 @@ unittest
}
/**
-Determines whether function $(D f) requires a context pointer.
+Determines whether function `f` requires a context pointer.
*/
template isNestedFunction(alias f)
{
@@ -5921,7 +5921,7 @@ unittest
}
/**
- * Detect whether $(D T) is a an abstract class.
+ * Detect whether `T` is a an abstract class.
*/
template isAbstractClass(T...)
if (T.length == 1)
@@ -5940,7 +5940,7 @@ unittest
}
/**
- * Detect whether $(D T) is a a final class.
+ * Detect whether `T` is a a final class.
*/
template isFinalClass(T...)
if (T.length == 1)
@@ -5965,7 +5965,7 @@ unittest
//::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
/**
-Removes all qualifiers, if any, from type $(D T).
+Removes all qualifiers, if any, from type `T`.
Example:
----
@@ -6046,9 +6046,9 @@ unittest
/**
Returns the inferred type of the loop variable when a variable of type T
-is iterated over using a $(D foreach) loop with a single loop variable and
+is iterated over using a `foreach` loop with a single loop variable and
automatically inferred return type. Note that this may not be the same as
-$(D std.range.ElementType!Range) in the case of narrow strings, or if T
+`std.range.ElementType!Range` in the case of narrow strings, or if T
has both opApply and a range interface.
*/
template ForeachType(T)
@@ -6074,7 +6074,7 @@ unittest
/**
- * Strips off all $(D enum)s from type $(D T).
+ * Strips off all `enum`s from type `T`.
*/
template OriginalType(T)
{
@@ -6294,9 +6294,9 @@ unittest
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::://
/**
-Returns the mangled name of symbol or type $(D sth).
+Returns the mangled name of symbol or type `sth`.
-$(D mangledName) is the same as builtin $(D .mangleof) property, except that
+`mangledName` is the same as builtin `.mangleof` property, except that
the correct names of property functions are obtained.
--------------------
module test;
@@ -6407,8 +6407,8 @@ unittest
// XXX Select & select should go to another module. (functional or algorithm?)
/**
-Aliases itself to $(D T[0]) if the boolean $(D condition) is $(D true)
-and to $(D T[1]) otherwise.
+Aliases itself to `T[0]` if the boolean `condition` is `true`
+and to `T[1]` otherwise.
*/
template Select(bool condition, T...) if (T.length == 2)
{
@@ -6432,8 +6432,8 @@ unittest
}
/**
-If $(D cond) is $(D true), returns $(D a) without evaluating $(D
-b). Otherwise, returns $(D b) without evaluating $(D a).
+If `cond` is `true`, returns `a` without evaluating $(D
+b). Otherwise, returns `b` without evaluating `a`.
*/
A select(bool cond : true, A, B)(A a, lazy B b) { return a; }
/// Ditto
diff --git a/std/typecons.d b/std/typecons.d
index b366b451897..acef678f4b0 100644
--- a/std/typecons.d
+++ b/std/typecons.d
@@ -50,15 +50,15 @@ import std.typetuple; // : TypeTuple, allSatisfy;
debug(Unique) import std.stdio;
/**
-Encapsulates unique ownership of a resource. Resource of type $(D T) is
+Encapsulates unique ownership of a resource. Resource of type `T` is
deleted at the end of the scope, unless it is transferred. The
-transfer can be explicit, by calling $(D release), or implicit, when
+transfer can be explicit, by calling `release`, or implicit, when
returning Unique from a function. The resource can be a polymorphic
class object, in which case Unique behaves polymorphically too.
*/
struct Unique(T)
{
-/** Represents a reference to $(D T). Resolves to $(D T*) if $(D T) is a value type. */
+/** Represents a reference to `T`. Resolves to `T*` if `T` is a value type. */
static if (is(T:Object))
alias RefT = T;
else
@@ -68,12 +68,12 @@ public:
// Deferred in case we get some language support for checking uniqueness.
version(None)
/**
- Allows safe construction of $(D Unique). It creates the resource and
- guarantees unique ownership of it (unless $(D T) publishes aliases of
- $(D this)).
+ Allows safe construction of `Unique`. It creates the resource and
+ guarantees unique ownership of it (unless `T` publishes aliases of
+ `this`).
Note: Nested structs/classes cannot be created.
Params:
- args = Arguments to pass to $(D T)'s constructor.
+ args = Arguments to pass to `T`'s constructor.
---
static class C {}
auto u = Unique!(C).create();
@@ -115,10 +115,10 @@ public:
assert(p is null);
}
/**
- Constructor that takes a $(D Unique) of a type that is convertible to our type.
+ Constructor that takes a `Unique` of a type that is convertible to our type.
- Typically used to transfer a $(D Unique) rvalue of derived type to
- a $(D Unique) of base type.
+ Typically used to transfer a `Unique` rvalue of derived type to
+ a `Unique` of base type.
Example:
---
class C : Object {}
@@ -135,7 +135,7 @@ public:
u._p = null;
}
- /// Transfer ownership from a $(D Unique) of a type that is convertible to our type.
+ /// Transfer ownership from a `Unique` of a type that is convertible to our type.
void opAssign(U)(Unique!U u)
if (is(u.RefT:RefT))
{
@@ -157,7 +157,7 @@ public:
{
return _p is null;
}
- /** Transfer ownership to a $(D Unique) rvalue. Nullifies the current contents. */
+ /** Transfer ownership to a `Unique` rvalue. Nullifies the current contents. */
Unique release()
{
debug(Unique) writeln("Release");
@@ -170,7 +170,7 @@ public:
RefT opDot() { return _p; }
/**
- Postblit operator is undefined to prevent the cloning of $(D Unique) objects.
+ Postblit operator is undefined to prevent the cloning of `Unique` objects.
*/
@disable this(this);
@@ -294,10 +294,10 @@ unittest
/**
Tuple of values, for example $(D Tuple!(int, string)) is a record that
-stores an $(D int) and a $(D string). $(D Tuple) can be used to bundle
+stores an `int` and a `string`. `Tuple` can be used to bundle
values together, notably when returning multiple values from a
-function. If $(D obj) is a tuple, the individual members are
-accessible with the syntax $(D obj[0]) for the first field, $(D obj[1])
+function. If `obj` is a tuple, the individual members are
+accessible with the syntax `obj[0]` for the first field, `obj[1]`
for the second, and so on.
The choice of zero-based indexing instead of one-base indexing was
@@ -452,7 +452,7 @@ template Tuple(Specs...)
static assert(isBuildable!(Tup1.Types[i], Tup2.Types[i]));
}));
- /+ Returns $(D true) iff a $(D T) can be initialized from a $(D U). +/
+ /+ Returns `true` iff a `T` can be initialized from a `U`. +/
enum isBuildable(T, U) = is(typeof(
{
U u = U.init;
@@ -483,9 +483,9 @@ template Tuple(Specs...)
alias fieldNames = staticMap!(extractName, fieldSpecs);
/**
- * Use $(D t.expand) for a tuple $(D t) to expand it into its
- * components. The result of $(D expand) acts as if the tuple components
- * were listed as a list of values. (Ordinarily, a $(D Tuple) acts as a
+ * Use `t.expand` for a tuple `t` to expand it into its
+ * components. The result of `expand` acts as if the tuple components
+ * were listed as a list of values. (Ordinarily, a `Tuple` acts as a
* single value.)
*
* Examples:
@@ -1132,7 +1132,7 @@ unittest
}
/**
-Returns a $(D Tuple) object instantiated and initialized according to
+Returns a `Tuple` object instantiated and initialized according to
the arguments.
Example:
@@ -1191,8 +1191,8 @@ template tuple(Names...)
}
/**
-Returns $(D true) if and only if $(D T) is an instance of the
-$(D Tuple) struct template.
+Returns `true` if and only if `T` is an instance of the
+`Tuple` struct template.
*/
template isTuple(T)
{
@@ -1270,13 +1270,13 @@ private mixin template RebindableCommon(T, U, alias This)
}
/**
-$(D Rebindable!(T)) is a simple, efficient wrapper that behaves just
-like an object of type $(D T), except that you can reassign it to
-refer to another object. For completeness, $(D Rebindable!(T)) aliases
-itself away to $(D T) if $(D T) is a non-const object type. However,
-$(D Rebindable!(T)) does not compile if $(D T) is a non-class type.
+`Rebindable!(T)` is a simple, efficient wrapper that behaves just
+like an object of type `T`, except that you can reassign it to
+refer to another object. For completeness, `Rebindable!(T)` aliases
+itself away to `T` if `T` is a non-const object type. However,
+`Rebindable!(T)` does not compile if `T` is a non-class type.
-Regular $(D const) object references cannot be reassigned:
+Regular `const` object references cannot be reassigned:
----
class Widget { int x; int y() const { return x; } }
@@ -1286,7 +1286,7 @@ a.x = 5; // error! can't modify const a
a = new Widget; // error! can't modify const a
----
-However, $(D Rebindable!(Widget)) does allow reassignment, while
+However, `Rebindable!(Widget)` does allow reassignment, while
otherwise behaving exactly like a $(D const Widget):
----
@@ -1296,11 +1296,11 @@ a.x = 5; // error! can't modify const a
a = new Widget; // fine
----
-You may want to use $(D Rebindable) when you want to have mutable
-storage referring to $(D const) objects, for example an array of
-references that must be sorted in place. $(D Rebindable) does not
+You may want to use `Rebindable` when you want to have mutable
+storage referring to `const` objects, for example an array of
+references that must be sorted in place. `Rebindable` does not
break the soundness of D's type system and does not incur any of the
-risks usually associated with $(D cast).
+risks usually associated with `cast`.
*/
template Rebindable(T) if (is(T == class) || is(T == interface) || isDynamicArray!T)
@@ -1327,7 +1327,7 @@ template Rebindable(T) if (is(T == class) || is(T == interface) || isDynamicArra
}
/**
-Convenience function for creating a $(D Rebindable) using automatic type
+Convenience function for creating a `Rebindable` using automatic type
inference.
*/
Rebindable!T rebindable(T)(T obj)
@@ -1339,9 +1339,9 @@ if (is(T == class) || is(T == interface) || isDynamicArray!T)
}
/**
-This function simply returns the $(D Rebindable) object passed in. It's useful
+This function simply returns the `Rebindable` object passed in. It's useful
in generic programming cases when a given object may be either a regular
-$(D class) or a $(D Rebindable).
+`class` or a `Rebindable`.
*/
Rebindable!T rebindable(T)(Rebindable!T obj)
{
@@ -1432,7 +1432,7 @@ unittest
}
/**
- Similar to $(D Rebindable!(T)) but strips all qualifiers from the reference as
+ Similar to `Rebindable!(T)` but strips all qualifiers from the reference as
opposed to just constness / immutability. Primary intended use case is with
shared (having thread-local reference to shared class data)
*/
@@ -1549,7 +1549,7 @@ unittest
Defines a value paired with a distinctive "null" state that denotes
the absence of a value. If default constructed, a $(D
Nullable!T) object starts in the null state. Assigning it renders it
-non-null. Calling $(D nullify) can nullify it again.
+non-null. Calling `nullify` can nullify it again.
Example:
----
@@ -1560,7 +1560,7 @@ assert(!a.isNull);
assert(a == 5);
----
-Practically $(D Nullable!T) stores a $(D T) and a $(D bool).
+Practically `Nullable!T` stores a `T` and a `bool`.
*/
struct Nullable(T)
{
@@ -1568,7 +1568,7 @@ struct Nullable(T)
private bool _isNull = true;
/**
-Constructor initializing $(D this) with $(D value).
+Constructor initializing `this` with `value`.
*/
this(inout T value) inout
{
@@ -1594,7 +1594,7 @@ Constructor initializing $(D this) with $(D value).
}
/**
-Returns $(D true) if and only if $(D this) is in the null state.
+Returns `true` if and only if `this` is in the null state.
*/
@property bool isNull() const @safe pure nothrow
{
@@ -1602,7 +1602,7 @@ Returns $(D true) if and only if $(D this) is in the null state.
}
/**
-Forces $(D this) to the null state.
+Forces `this` to the null state.
*/
void nullify()()
{
@@ -1611,8 +1611,8 @@ Forces $(D this) to the null state.
}
/**
-Assigns $(D value) to the internally-held state. If the assignment
-succeeds, $(D this) becomes non-null.
+Assigns `value` to the internally-held state. If the assignment
+succeeds, `this` becomes non-null.
*/
void opAssign()(T value)
{
@@ -1621,8 +1621,8 @@ succeeds, $(D this) becomes non-null.
}
/**
-Gets the value. $(D this) must not be in the null state.
-This function is also called for the implicit conversion to $(D T).
+Gets the value. `this` must not be in the null state.
+This function is also called for the implicit conversion to `T`.
*/
@property ref inout(T) get() inout @safe pure nothrow
{
@@ -1632,8 +1632,8 @@ This function is also called for the implicit conversion to $(D T).
}
/**
-Implicitly converts to $(D T).
-$(D this) must not be in the null state.
+Implicitly converts to `T`.
+`this` must not be in the null state.
*/
alias get this;
}
@@ -1911,18 +1911,18 @@ unittest
}
/**
-Just like $(D Nullable!T), except that the null state is defined as a
+Just like `Nullable!T`, except that the null state is defined as a
particular value. For example, $(D Nullable!(uint, uint.max)) is an
-$(D uint) that sets aside the value $(D uint.max) to denote a null
+`uint` that sets aside the value `uint.max` to denote a null
state. $(D Nullable!(T, nullValue)) is more storage-efficient than $(D
-Nullable!T) because it does not need to store an extra $(D bool).
+Nullable!T) because it does not need to store an extra `bool`.
*/
struct Nullable(T, T nullValue)
{
private T _value = nullValue;
/**
-Constructor initializing $(D this) with $(D value).
+Constructor initializing `this` with `value`.
*/
this(T value)
{
@@ -1947,7 +1947,7 @@ Constructor initializing $(D this) with $(D value).
}
/**
-Returns $(D true) if and only if $(D this) is in the null state.
+Returns `true` if and only if `this` is in the null state.
*/
@property bool isNull() const
{
@@ -1964,7 +1964,7 @@ Returns $(D true) if and only if $(D this) is in the null state.
}
/**
-Forces $(D this) to the null state.
+Forces `this` to the null state.
*/
void nullify()()
{
@@ -1972,8 +1972,8 @@ Forces $(D this) to the null state.
}
/**
-Assigns $(D value) to the internally-held state. No null checks are
-made. Note that the assignment may leave $(D this) in the null state.
+Assigns `value` to the internally-held state. No null checks are
+made. Note that the assignment may leave `this` in the null state.
*/
void opAssign()(T value)
{
@@ -1981,8 +1981,8 @@ made. Note that the assignment may leave $(D this) in the null state.
}
/**
-Gets the value. $(D this) must not be in the null state.
-This function is also called for the implicit conversion to $(D T).
+Gets the value. `this` must not be in the null state.
+This function is also called for the implicit conversion to `T`.
*/
@property ref inout(T) get() inout
{
@@ -1994,8 +1994,8 @@ This function is also called for the implicit conversion to $(D T).
}
/**
-Implicitly converts to $(D T).
-Gets the value. $(D this) must not be in the null state.
+Implicitly converts to `T`.
+Gets the value. `this` must not be in the null state.
*/
alias get this;
}
@@ -2128,17 +2128,17 @@ unittest
/**
-Just like $(D Nullable!T), except that the object refers to a value
+Just like `Nullable!T`, except that the object refers to a value
sitting elsewhere in memory. This makes assignments overwrite the
-initially assigned value. Internally $(D NullableRef!T) only stores a
-pointer to $(D T) (i.e., $(D Nullable!T.sizeof == (T*).sizeof)).
+initially assigned value. Internally `NullableRef!T` only stores a
+pointer to `T` (i.e., $(D Nullable!T.sizeof == (T*).sizeof)).
*/
struct NullableRef(T)
{
private T* _value;
/**
-Constructor binding $(D this) with $(D value).
+Constructor binding `this` with `value`.
*/
this(T* value) @safe pure nothrow
{
@@ -2163,7 +2163,7 @@ Constructor binding $(D this) with $(D value).
}
/**
-Binds the internal state to $(D value).
+Binds the internal state to `value`.
*/
void bind(T* value) @safe pure nothrow
{
@@ -2171,7 +2171,7 @@ Binds the internal state to $(D value).
}
/**
-Returns $(D true) if and only if $(D this) is in the null state.
+Returns `true` if and only if `this` is in the null state.
*/
@property bool isNull() const @safe pure nothrow
{
@@ -2179,7 +2179,7 @@ Returns $(D true) if and only if $(D this) is in the null state.
}
/**
-Forces $(D this) to the null state.
+Forces `this` to the null state.
*/
void nullify() @safe pure nothrow
{
@@ -2187,7 +2187,7 @@ Forces $(D this) to the null state.
}
/**
-Assigns $(D value) to the internally-held state.
+Assigns `value` to the internally-held state.
*/
void opAssign()(T value)
if (isAssignable!T) //@@@9416@@@
@@ -2198,8 +2198,8 @@ Assigns $(D value) to the internally-held state.
}
/**
-Gets the value. $(D this) must not be in the null state.
-This function is also called for the implicit conversion to $(D T).
+Gets the value. `this` must not be in the null state.
+This function is also called for the implicit conversion to `T`.
*/
@property ref inout(T) get() inout @safe pure nothrow
{
@@ -2209,8 +2209,8 @@ This function is also called for the implicit conversion to $(D T).
}
/**
-Implicitly converts to $(D T).
-$(D this) must not be in the null state.
+Implicitly converts to `T`.
+`this` must not be in the null state.
*/
alias get this;
}
@@ -2351,8 +2351,8 @@ unittest
/**
-$(D BlackHole!Base) is a subclass of $(D Base) which automatically implements
-all abstract member functions in $(D Base) as do-nothing functions. Each
+`BlackHole!Base` is a subclass of `Base` which automatically implements
+all abstract member functions in `Base` as do-nothing functions. Each
auto-implemented function just returns the default value of the return type
without doing anything.
@@ -2432,9 +2432,9 @@ unittest
/**
-$(D WhiteHole!Base) is a subclass of $(D Base) which automatically implements
+`WhiteHole!Base` is a subclass of `Base` which automatically implements
all abstract member functions as throw-always functions. Each auto-implemented
-function fails with throwing an $(D Error) and does never return. Useful for
+function fails with throwing an `Error` and does never return. Useful for
trapping use of not-yet-implemented functions.
The name came from
@@ -2502,22 +2502,22 @@ unittest
/**
-$(D AutoImplement) automatically implements (by default) all abstract member
-functions in the class or interface $(D Base) in specified way.
+`AutoImplement` automatically implements (by default) all abstract member
+functions in the class or interface `Base` in specified way.
Params:
how = template which specifies _how functions will be implemented/overridden.
- Two arguments are passed to $(D how): the type $(D Base) and an alias
- to an implemented function. Then $(D how) must return an implemented
+ Two arguments are passed to `how`: the type `Base` and an alias
+ to an implemented function. Then `how` must return an implemented
function body as a string.
The generated function body can use these keywords:
$(UL
- $(LI $(D a0), $(D a1), …: arguments passed to the function;)
- $(LI $(D args): a tuple of the arguments;)
- $(LI $(D self): an alias to the function itself;)
- $(LI $(D parent): an alias to the overridden function (if any).)
+ $(LI `a0`, `a1`, …: arguments passed to the function;)
+ $(LI `args`: a tuple of the arguments;)
+ $(LI `self`: an alias to the function itself;)
+ $(LI `parent`: an alias to the overridden function (if any).)
)
You may want to use templated property functions (instead of Implicit
@@ -2550,9 +2550,9 @@ string generateLogger(C, alias fun)() @property
what = template which determines _what functions should be
implemented/overridden.
- An argument is passed to $(D what): an alias to a non-final member
- function in $(D Base). Then $(D what) must return a boolean value.
- Return $(D true) to indicate that the passed function should be
+ An argument is passed to `what`: an alias to a non-final member
+ function in `Base`. Then `what` must return a boolean value.
+ Return `true` to indicate that the passed function should be
implemented/overridden.
--------------------
@@ -2563,10 +2563,10 @@ enum bool hasValue(alias fun) = !is(ReturnType!(fun) == void);
Note:
-Generated code is inserted in the scope of $(D std.typecons) module. Thus,
-any useful functions outside $(D std.typecons) cannot be used in the generated
-code. To workaround this problem, you may $(D import) necessary things in a
-local struct, as done in the $(D generateLogger()) template in the above
+Generated code is inserted in the scope of `std.typecons` module. Thus,
+any useful functions outside `std.typecons` cannot be used in the generated
+code. To workaround this problem, you may `import` necessary things in a
+local struct, as done in the `generateLogger()` template in the above
example.
@@ -2577,9 +2577,9 @@ $(UL
$(LI Deep interface inheritance causes compile error with messages like
"Error: function std.typecons._AutoImplement!(Foo)._AutoImplement.bar
does not override any function". [$(BUGZILLA 2525), $(BUGZILLA 3525)] )
- $(LI The $(D parent) keyword is actually a delegate to the super class'
+ $(LI The `parent` keyword is actually a delegate to the super class'
corresponding member function. [$(BUGZILLA 2540)] )
- $(LI Using alias template parameter in $(D how) and/or $(D what) may cause
+ $(LI Using alias template parameter in `how` and/or `what` may cause
strange compile error. Use template tuple parameter instead to workaround
this problem. [$(BUGZILLA 4217)] )
)
@@ -3208,8 +3208,8 @@ private static:
/**
-Predefined how-policies for $(D AutoImplement). These templates are used by
-$(D BlackHole) and $(D WhiteHole), respectively.
+Predefined how-policies for `AutoImplement`. These templates are used by
+`BlackHole` and `WhiteHole`, respectively.
*/
template generateEmptyFunction(C, func.../+[BUG 4217]+/)
{
@@ -3286,9 +3286,9 @@ unittest
/**
* Supports structural based typesafe conversion.
*
- * If $(D Source) has structural conformance with the $(D interface) $(D Targets),
- * wrap creates internal wrapper class which inherits $(D Targets) and
- * wrap $(D src) object, then return it.
+ * If `Source` has structural conformance with the `interface` `Targets`,
+ * wrap creates internal wrapper class which inherits `Targets` and
+ * wrap `src` object, then return it.
*/
template wrap(Targets...)
if (Targets.length >= 1 && allSatisfy!(isMutable, Targets))
@@ -3478,7 +3478,7 @@ private interface Structural
}
/**
- * Extract object which wrapped by $(D wrap).
+ * Extract object which wrapped by `wrap`.
*/
template unwrap(Target)
if (isMutable!Target)
@@ -3993,8 +3993,8 @@ private template Bind(alias Template, args1...)
/**
-Options regarding auto-initialization of a $(D RefCounted) object (see
-the definition of $(D RefCounted) below).
+Options regarding auto-initialization of a `RefCounted` object (see
+the definition of `RefCounted` below).
*/
enum RefCountedAutoInitialize
{
@@ -4005,26 +4005,26 @@ enum RefCountedAutoInitialize
}
/**
-Defines a reference-counted object containing a $(D T) value as
-payload. $(D RefCounted) keeps track of all references of an object,
+Defines a reference-counted object containing a `T` value as
+payload. `RefCounted` keeps track of all references of an object,
and when the reference count goes down to zero, frees the underlying
-store. $(D RefCounted) uses $(D malloc) and $(D free) for operation.
+store. `RefCounted` uses `malloc` and `free` for operation.
-$(D RefCounted) is unsafe and should be used with care. No references
-to the payload should be escaped outside the $(D RefCounted) object.
+`RefCounted` is unsafe and should be used with care. No references
+to the payload should be escaped outside the `RefCounted` object.
-The $(D autoInit) option makes the object ensure the store is
+The `autoInit` option makes the object ensure the store is
automatically initialized. Leaving $(D autoInit ==
RefCountedAutoInitialize.yes) (the default option) is convenient but
has the cost of a test whenever the payload is accessed. If $(D
autoInit == RefCountedAutoInitialize.no), user code must call either
-$(D refCountedStore.isInitialized) or $(D refCountedStore.ensureInitialized)
+`refCountedStore.isInitialized` or `refCountedStore.ensureInitialized`
before attempting to access the payload. Not doing so results in null
pointer dereference.
Example:
----
-// A pair of an $(D int) and a $(D size_t) - the latter being the
+// A pair of an `int` and a $(D size_t) - the latter being the
// reference count - will be dynamically allocated
auto rc1 = RefCounted!int(5);
assert(rc1 == 5);
@@ -4040,7 +4040,7 @@ struct RefCounted(T, RefCountedAutoInitialize autoInit =
RefCountedAutoInitialize.yes)
if (!is(T == class))
{
- /// $(D RefCounted) storage implementation.
+ /// `RefCounted` storage implementation.
struct RefCountedStore
{
private struct Impl
@@ -4066,7 +4066,7 @@ if (!is(T == class))
}
/**
- Returns $(D true) if and only if the underlying store has been
+ Returns `true` if and only if the underlying store has been
allocated and initialized.
*/
@property nothrow @safe
@@ -4077,7 +4077,7 @@ if (!is(T == class))
/**
Returns underlying reference count if it is allocated and initialized
- (a positive integer), and $(D 0) otherwise.
+ (a positive integer), and `0` otherwise.
*/
@property nothrow @safe
size_t refCount() const
@@ -4107,7 +4107,7 @@ if (!is(T == class))
/**
Constructor that initializes the payload.
-Postcondition: $(D refCountedStore.isInitialized)
+Postcondition: `refCountedStore.isInitialized`
*/
this(A...)(auto ref A args) if (A.length > 0)
{
@@ -4127,7 +4127,7 @@ Constructor that tracks the reference count appropriately. If $(D
/**
Destructor that tracks the reference count appropriately. If $(D
!refCountedStore.isInitialized), does nothing. When the reference count goes
-down to zero, calls $(D destroy) agaist the payload and calls $(D free)
+down to zero, calls `destroy` agaist the payload and calls `free`
to deallocate the corresponding resource.
*/
~this()
@@ -4182,13 +4182,13 @@ Assignment operators
RefCountedAutoInitialize.yes), calls $(D
refCountedStore.ensureInitialized). Otherwise, just issues $(D
assert(refCountedStore.isInitialized)). Used with $(D alias
- refCountedPayload this;), so callers can just use the $(D RefCounted)
- object as a $(D T).
+ refCountedPayload this;), so callers can just use the `RefCounted`
+ object as a `T`.
$(BLUE The first overload exists only if $(D autoInit == RefCountedAutoInitialize.yes).)
So if $(D autoInit == RefCountedAutoInitialize.no)
or called for a constant or immutable object, then
- $(D refCountedPayload) will also be qualified as safe and nothrow
+ `refCountedPayload` will also be qualified as safe and nothrow
(but will still assert if not initialized).
*/
@property
@@ -4312,7 +4312,7 @@ unittest
}
/**
-Make proxy for $(D a).
+Make proxy for `a`.
Example:
----
@@ -4852,7 +4852,7 @@ unittest
/**
$(B Typedef) allows the creation of a unique type which is
-based on an existing type. Unlike the $(D alias) feature,
+based on an existing type. Unlike the `alias` feature,
$(B Typedef) ensures the two types are not considered as equals.
Example:
@@ -4881,7 +4881,7 @@ assert(myInt == 10); // default-initialized to 10
----
cookie = Optional, used to create multiple unique types which are
-based on the same origin type $(D T). For example:
+based on the same origin type `T`. For example:
----
alias TypeInt1 = Typedef!int;
@@ -4898,7 +4898,7 @@ static assert(!is(MoneyEuros == MoneyDollars));
----
Note: If a library routine cannot handle the Typedef type,
-you can use the $(D TypedefType) template to extract the
+you can use the `TypedefType` template to extract the
type which the Typedef wraps.
*/
struct Typedef(T, T init = T.init, string cookie=null)
@@ -4931,8 +4931,8 @@ struct Typedef(T, T init = T.init, string cookie=null)
}
/**
-Get the underlying type which a $(D Typedef) wraps.
-If $(D T) is not a $(D Typedef) it will alias itself to $(D T).
+Get the underlying type which a `Typedef` wraps.
+If `T` is not a `Typedef` it will alias itself to `T`.
*/
template TypedefType(T)
{
@@ -5128,8 +5128,8 @@ unittest
}
/**
-Allocates a $(D class) object right inside the current scope,
-therefore avoiding the overhead of $(D new). This facility is unsafe;
+Allocates a `class` object right inside the current scope,
+therefore avoiding the overhead of `new`. This facility is unsafe;
it is the responsibility of the user to not escape a reference to the
object outside the scope.
@@ -5483,13 +5483,13 @@ unittest
Defines a simple, self-documenting yes/no flag. This makes it easy for
APIs to define functions accepting flags without resorting to $(D
bool), which is opaque in calls, and without needing to define an
-enumerated type separately. Using $(D Flag!"Name") instead of $(D
+enumerated type separately. Using `Flag!"Name"` instead of $(D
bool) makes the flag's meaning visible in calls. Each yes/no flag has
its own type, which makes confusions and mix-ups impossible.
Example:
-Code calling $(D getLine) (usually far away from its definition) can't be
+Code calling `getLine` (usually far away from its definition) can't be
understood without looking at the documentation, even by users familiar with
the API:
----
@@ -5506,8 +5506,8 @@ auto line = getLine(false);
Assuming the reverse meaning (i.e. "ignoreTerminator") and inserting the wrong
code compiles and runs with erroneous results.
-After replacing the boolean parameter with an instantiation of $(D Flag), code
-calling $(D getLine) can be easily read and understood even by people not
+After replacing the boolean parameter with an instantiation of `Flag`, code
+calling `getLine` can be easily read and understood even by people not
fluent with the API:
----
@@ -5521,11 +5521,11 @@ string getLine(Flag!"keepTerminator" keepTerminator)
auto line = getLine(Flag!"keepTerminator".yes);
----
-Passing categorical data by means of unstructured $(D bool)
+Passing categorical data by means of unstructured `bool`
parameters is classified under "simple-data coupling" by Steve
McConnell in the $(LUCKY Code Complete) book, along with three other
kinds of coupling. The author argues citing several studies that
-coupling has a negative effect on code quality. $(D Flag) offers a
+coupling has a negative effect on code quality. `Flag` offers a
simple structuring method for passing yes/no flags to APIs.
An alias can be used to reduce the verbosity of the flag's type:
@@ -5547,15 +5547,15 @@ template Flag(string name) {
enum Flag : bool
{
/**
- When creating a value of type $(D Flag!"Name"), use $(D
+ When creating a value of type `Flag!"Name"`, use $(D
Flag!"Name".no) for the negative option. When using a value
- of type $(D Flag!"Name"), compare it against $(D
- Flag!"Name".no) or just $(D false) or $(D 0). */
+ of type `Flag!"Name"`, compare it against $(D
+ Flag!"Name".no) or just `false` or `0`. */
no = false,
- /** When creating a value of type $(D Flag!"Name"), use $(D
+ /** When creating a value of type `Flag!"Name"`, use $(D
Flag!"Name".yes) for the affirmative option. When using a
- value of type $(D Flag!"Name"), compare it against $(D
+ value of type `Flag!"Name"`, compare it against $(D
Flag!"Name".yes).
*/
yes = true
@@ -5563,8 +5563,8 @@ template Flag(string name) {
}
/**
-Convenience names that allow using e.g. $(D Yes.encryption) instead of
-$(D Flag!"encryption".yes) and $(D No.encryption) instead of $(D
+Convenience names that allow using e.g. `Yes.encryption` instead of
+`Flag!"encryption".yes` and `No.encryption` instead of $(D
Flag!"encryption".no).
*/
struct Yes
@@ -5665,7 +5665,7 @@ A typesafe structure for storing combination of enum values.
This template defines a simple struct to represent bitwise OR combinations of
enum values. It can be used if all the enum values are integral constants with
-a bit count of at most 1, or if the $(D unsafe) parameter is explicitly set to
+a bit count of at most 1, or if the `unsafe` parameter is explicitly set to
Yes.
This is much safer than using the enum itself to store
the OR combination, which can produce surprising effects like this:
@@ -5826,7 +5826,7 @@ public:
}
static assert(__traits(compiles, BitFlags!Enum));
- // You need to specify the $(D unsafe) parameter for enum with custom values
+ // You need to specify the `unsafe` parameter for enum with custom values
enum UnsafeEnum
{
A,
diff --git a/std/typelist.d b/std/typelist.d
index 9609b821bf3..ac8a2e06e3d 100644
--- a/std/typelist.d
+++ b/std/typelist.d
@@ -48,13 +48,13 @@ version(unittest) {
/**
* Creates a compile-time list of types from a tuple.
- * $(D TypeList)s are more general than tuples because
- * you can pass more than one $(D TypeList) to a template.
+ * `TypeList`s are more general than tuples because
+ * you can pass more than one `TypeList` to a template.
* You may also combine them into higher-order structures.
- * $(D TypeList)s are passed to other templates as alias parameters
- * To create an empty list use $(D TypeList!())
+ * `TypeList`s are passed to other templates as alias parameters
+ * To create an empty list use `TypeList!()`
*
- * $(D TypeList) efines several "methods":
+ * `TypeList` efines several "methods":
*
* $(D_PARAM toTuple), $(D_PARAM head), $(D_PARAM tail), $(D_PARAM length), $(D_PARAM isEmpty)
*
@@ -104,7 +104,7 @@ unittest {
}
/**
- * Appends a type tuple to a $(D TypeList), returns a $(D TypeList)
+ * Appends a type tuple to a `TypeList`, returns a `TypeList`
*/
template AppendTypes(alias List, T...)
{
@@ -123,7 +123,7 @@ unittest {
}
/**
- * Appends one $(D TypeList) to another, returns a $(D TypeList)
+ * Appends one `TypeList` to another, returns a `TypeList`
*/
template Append(alias Left, alias Right)
{
@@ -139,7 +139,7 @@ unittest {
}
/**
- * Prepends a type to a $(D TypeList), returns a $(D TypeList)
+ * Prepends a type to a `TypeList`, returns a `TypeList`
*/
template Cons(T, alias List)
{
@@ -160,7 +160,7 @@ unittest {
}
/**
- * Tests if all emements of a $(D TypeList) against a predicate.
+ * Tests if all emements of a `TypeList` against a predicate.
* Returns true if all all types satisfy the predicate, false otherwise.
*/
template All(alias List, alias F)
@@ -187,7 +187,7 @@ unittest {
}
/**
- * Tests if there is an emement in a $(D TypeList) that satisfies a predicate.
+ * Tests if there is an emement in a `TypeList` that satisfies a predicate.
*/
template Any(alias List, alias F)
{
@@ -211,7 +211,7 @@ template Map(alias F, T...)
}
/**
- * Applies a given "function" to a $(D TypeList). Returns a $(D TypeList) of results
+ * Applies a given "function" to a `TypeList`. Returns a `TypeList` of results
*/
private template Map(alias F, alias List)
{
@@ -243,7 +243,7 @@ template Filter(alias Pred, T...)
}
/**
- * Filters a $(D TypeList) using a predicate. Returns a $(D TypeList) of elements that
+ * Filters a `TypeList` using a predicate. Returns a `TypeList` of elements that
* satisfy the predicate.
*/
template Filter(alias Pred, alias List)
@@ -348,7 +348,7 @@ unittest {
}
/** Negates a type predicate.
- * The negated predicate is a "member" $(D apply).
+ * The negated predicate is a "member" `apply`.
*
* Example:
* ----
@@ -369,7 +369,7 @@ unittest {
}
/** Combines two type predicates using logical OR.
- * The resulting predicate is callable through the field $(D apply)
+ * The resulting predicate is callable through the field `apply`
*
* Example:
* ----
@@ -391,7 +391,7 @@ unittest {
}
/** Combines a list of type predicates using logical OR.
- * The resulting predicate is callable through the field $(D apply)
+ * The resulting predicate is callable through the field `apply`
*/
template Or(alias FList)
{
@@ -413,7 +413,7 @@ unittest {
}
/** Combines two type predicates using logical AND.
- * The resulting predicate is callable through the field $(D apply)
+ * The resulting predicate is callable through the field `apply`
*
* Example:
* ----
@@ -435,7 +435,7 @@ unittest {
}
/** Combines a list of type predicates using logical AND.
- * The resulting predicate is callable through the field $(D apply)
+ * The resulting predicate is callable through the field `apply`
*/
template And(alias FList)
{
diff --git a/std/typetuple.d b/std/typetuple.d
index bba40bb81c2..e9661660efb 100644
--- a/std/typetuple.d
+++ b/std/typetuple.d
@@ -652,8 +652,8 @@ unittest
/**
- * Filters a $(D TypeTuple) using a template predicate. Returns a
- * $(D TypeTuple) of the elements which satisfy the predicate.
+ * Filters a `TypeTuple` using a template predicate. Returns a
+ * `TypeTuple` of the elements which satisfy the predicate.
*/
template Filter(alias pred, TList...)
{
diff --git a/std/uni.d b/std/uni.d
index 432b412608a..cb6e7f03801 100644
--- a/std/uni.d
+++ b/std/uni.d
@@ -1,7 +1,7 @@
// Written in the D programming language.
/++
- $(P The $(D std.uni) module provides an implementation
+ $(P The `std.uni` module provides an implementation
of fundamental Unicode algorithms and data structures.
This doesn't include UTF encoding and decoding primitives,
see $(XREF _utf, decode) and $(XREF _utf, encode) in std.utf
@@ -220,11 +220,11 @@
$(P $(DEF Code unit) The minimal bit combination that can represent
a unit of encoded text for processing or interchange.
Depending on the encoding this could be:
- 8-bit code units in the UTF-8 ($(D char)),
- 16-bit code units in the UTF-16 ($(D wchar)),
- and 32-bit code units in the UTF-32 ($(D dchar)).
+ 8-bit code units in the UTF-8 (`char`),
+ 16-bit code units in the UTF-16 (`wchar`),
+ and 32-bit code units in the UTF-32 (`dchar`).
$(I Note that in UTF-32, a code unit is a code point
- and is represented by the D $(D dchar) type.)
+ and is represented by the D `dchar` type.)
)
$(P $(DEF Combining character) A character with the General Category
@@ -394,13 +394,13 @@
the lower bits as an offset within this page.
Assuming that pages are laid out consequently
- in one array at $(D pages), the pseudo-code is:
+ in one array at `pages`, the pseudo-code is:
)
---
auto elemsPerPage = (2 ^^ bits_per_page) / Value.sizeOfInBits;
pages[index[n >> bits_per_page]][n & (elemsPerPage - 1)];
---
- $(P Where if $(D elemsPerPage) is a power of 2 the whole process is
+ $(P Where if `elemsPerPage` is a power of 2 the whole process is
a handful of simple instructions and 2 array reads. Subsequent levels
of the trie are introduced by recursing on this notion - the index array
is treated as values. The number of bits in index is then again
@@ -409,7 +409,7 @@
$(P For completeness a level 1 trie is simply an array.
The current implementation takes advantage of bit-packing values
- when the range is known to be limited in advance (such as $(D bool)).
+ when the range is known to be limited in advance (such as `bool`).
See also $(LREF BitPacked) for enforcing it manually.
The major size advantage however comes from the fact
that multiple $(B identical pages on every level are merged) by construction.
@@ -418,7 +418,7 @@
$(P The process of constructing a trie is more involved and is hidden from
the user in a form of the convenience functions $(LREF codepointTrie),
$(LREF codepointSetTrie) and the even more convenient $(LREF toTrie).
- In general a set or built-in AA with $(D dchar) type
+ In general a set or built-in AA with `dchar` type
can be turned into a trie. The trie object in this module
is read-only (immutable); it's effectively frozen after construction.
)
@@ -1829,8 +1829,8 @@ public template isCodepointSet(T)
}
/**
- Tests if $(D T) is a pair of integers that implicitly convert to $(D V).
- The following code must compile for any pair $(D T):
+ Tests if `T` is a pair of integers that implicitly convert to `V`.
+ The following code must compile for any pair `T`:
---
(T x){ V a = x[0]; V b = x[1];}
---
@@ -1903,7 +1903,7 @@ pure:
/**
$(P
- $(D InversionList) is a set of $(CODEPOINTS)
+ `InversionList` is a set of $(CODEPOINTS)
represented as an array of open-right [a, b$(RPAREN)
intervals (see $(LREF CodepointInterval) above).
The name comes from the way the representation reads left to right.
@@ -1927,7 +1927,7 @@ pure:
on $(LUCKY RLE encoding).
)
- $(P Sets are value types (just like $(D int) is) thus they
+ $(P Sets are value types (just like `int` is) thus they
are never aliased.
)
Example:
@@ -1951,7 +1951,7 @@ pure:
Note:
$(P It's not recommended to rely on the template parameters
- or the exact type of a current $(CODEPOINT) set in $(D std.uni).
+ or the exact type of a current $(CODEPOINT) set in `std.uni`.
The type and parameters may change when the standard
allocators design is finalized.
Use $(LREF isCodepointSet) with templates or just stick with the default
@@ -2075,7 +2075,7 @@ public:
}
/**
- Tests the presence of code point $(D val) in this set.
+ Tests the presence of code point `val` in this set.
Example:
---
@@ -2093,7 +2093,7 @@ public:
return sharSwitchLowerBound!"a<=b"(data[], val) & 1;
}
- // Linear scan for $(D ch). Useful only for small sets.
+ // Linear scan for `ch`. Useful only for small sets.
// TODO:
// used internally in std.regex
// should be properly exposed in a public API ?
@@ -2221,7 +2221,7 @@ public:
}
/**
- Tests the presence of codepoint $(D ch) in this set,
+ Tests the presence of codepoint `ch` in this set,
the same as $(LREF opIndex).
*/
bool opBinaryRight(string op: "in", U)(U ch) const
@@ -2301,7 +2301,7 @@ public:
/**
$(P Obtain textual representation of this set in from of
- open-right intervals and feed it to $(D sink).
+ open-right intervals and feed it to `sink`.
)
$(P Used by various standard formatting facilities such as
$(XREF _format, formattedWrite), $(XREF _stdio, write),
@@ -2497,7 +2497,7 @@ public:
/**
Generates string with D source code of unary function with name of
- $(D funcName) taking a single $(D dchar) argument. If $(D funcName) is empty
+ `funcName` taking a single `dchar` argument. If `funcName` is empty
the code is adjusted to be a lambda function.
The function generated tests if the $(CODEPOINT) passed
@@ -3691,8 +3691,8 @@ auto arrayRepr(T)(T x)
}
/**
- Maps $(D Key) to a suitable integer index within the range of $(D size_t).
- The mapping is constructed by applying predicates from $(D Prefix) left to right
+ Maps `Key` to a suitable integer index within the range of $(D size_t).
+ The mapping is constructed by applying predicates from `Prefix` left to right
and concatenating the resulting bits.
The first (leftmost) predicate defines the most significant bits of
@@ -3716,7 +3716,7 @@ template mapTrieIndex(Prefix...)
}
/*
- $(D TrieBuilder) is a type used for incremental construction
+ `TrieBuilder` is a type used for incremental construction
of $(LREF Trie)s.
See $(LREF buildTrie) for generic helpers built on top of it.
@@ -3944,7 +3944,7 @@ private:
public:
/**
- Construct a builder, where $(D filler) is a value
+ Construct a builder, where `filler` is a value
to indicate empty slots (or "not found" condition).
*/
this(Value filler)
@@ -3961,9 +3961,9 @@ public:
}
/**
- Put a value $(D v) into interval as
- mapped by keys from $(D a) to $(D b).
- All slots prior to $(D a) are filled with
+ Put a value `v` into interval as
+ mapped by keys from `a` to `b`.
+ All slots prior to `a` are filled with
the default filler.
*/
void putRange(Key a, Key b, Value v)
@@ -3975,8 +3975,8 @@ public:
}
/**
- Put a value $(D v) into slot mapped by $(D key).
- All slots prior to $(D key) are filled with the
+ Put a value `v` into slot mapped by `key`.
+ All slots prior to `key` are filled with the
default filler.
*/
void putValue(Key key, Value v)
@@ -4049,7 +4049,7 @@ public:
}
/*
- $(P Lookup the $(D key) in this $(D Trie). )
+ $(P Lookup the `key` in this `Trie`. )
$(P The lookup always succeeds if key fits the domain
provided during construction. The whole domain defined
@@ -4057,7 +4057,7 @@ public:
the sentinel (filler) value could be used. )
$(P See $(LREF buildTrie), $(LREF TrieBuilder) for how to
- define a domain of $(D Trie) keys and the sentinel value. )
+ define a domain of `Trie` keys and the sentinel value. )
Note:
Domain range-checking is only enabled in debug builds
@@ -4124,10 +4124,10 @@ template callableWith(T)
}
/*
- Check if $(D Prefix) is a valid set of predicates
- for $(D Trie) template having $(D Key) as the type of keys.
+ Check if `Prefix` is a valid set of predicates
+ for `Trie` template having `Key` as the type of keys.
This requires all predicates to be callable, take
- single argument of type $(D Key) and return unsigned value.
+ single argument of type `Key` and return unsigned value.
*/
template isValidPrefixForTrie(Key, Prefix...)
{
@@ -4135,8 +4135,8 @@ template isValidPrefixForTrie(Key, Prefix...)
}
/*
- Check if $(D Args) is a set of maximum key value followed by valid predicates
- for $(D Trie) template having $(D Key) as the type of keys.
+ Check if `Args` is a set of maximum key value followed by valid predicates
+ for `Trie` template having `Key` as the type of keys.
*/
template isValidArgsForTrie(Key, Args...)
{
@@ -4159,10 +4159,10 @@ template isValidArgsForTrie(Key, Args...)
/**
A shorthand for creating a custom multi-level fixed Trie
- from a $(D CodepointSet). $(D sizes) are numbers of bits per level,
+ from a `CodepointSet`. `sizes` are numbers of bits per level,
with the most significant bits used first.
- Note: The sum of $(D sizes) must be equal 21.
+ Note: The sum of `sizes` must be equal 21.
See_Also: $(LREF toTrie), which is even simpler.
@@ -4206,14 +4206,14 @@ public template CodepointSetTrie(sizes...)
}
/**
- A slightly more general tool for building fixed $(D Trie)
+ A slightly more general tool for building fixed `Trie`
for the Unicode data.
- Specifically unlike $(D codepointSetTrie) it's allows creating mappings
- of $(D dchar) to an arbitrary type $(D T).
+ Specifically unlike `codepointSetTrie` it's allows creating mappings
+ of `dchar` to an arbitrary type `T`.
- Note: Overload taking $(D CodepointSet)s will naturally convert
- only to bool mapping $(D Trie)s.
+ Note: Overload taking `CodepointSet`s will naturally convert
+ only to bool mapping `Trie`s.
Example:
---
@@ -4364,15 +4364,15 @@ public template cmpK0(alias Pred)
}
/*
- The most general utility for construction of $(D Trie)s
- short of using $(D TrieBuilder) directly.
+ The most general utility for construction of `Trie`s
+ short of using `TrieBuilder` directly.
Provides a number of convenience overloads.
- $(D Args) is tuple of maximum key value followed by
+ `Args` is tuple of maximum key value followed by
predicates to construct index from key.
- Alternatively if the first argument is not a value convertible to $(D Key)
- then the whole tuple of $(D Args) is treated as predicates
+ Alternatively if the first argument is not a value convertible to `Key`
+ then the whole tuple of `Args` is treated as predicates
and the maximum Key is deduced from predicates.
*/
public template buildTrie(Value, Key, Args...)
@@ -4398,7 +4398,7 @@ public template buildTrie(Value, Key, Args...)
}
/*
- Build $(D Trie) from a range of a Key-Value pairs,
+ Build `Trie` from a range of a Key-Value pairs,
assuming it is sorted by Key as defined by the following lambda:
------
(a, b) => mapTrieIndex!(Prefix)(a) < mapTrieIndex!(Prefix)(b)
@@ -4406,7 +4406,7 @@ public template buildTrie(Value, Key, Args...)
Exception is thrown if it's detected that the above order doesn't hold.
In other words $(LREF mapTrieIndex) should be a
- monotonically increasing function that maps $(D Key) to an integer.
+ monotonically increasing function that maps `Key` to an integer.
See_Also: $(XREF _algorithm, sort),
$(XREF _range, SortedRange),
@@ -4423,14 +4423,14 @@ public template buildTrie(Value, Key, Args...)
}
/*
- If $(D Value) is bool (or BitPacked!(bool, x)) then it's possible
- to build $(D Trie) from a range of open-right intervals of $(D Key)s.
+ If `Value` is bool (or BitPacked!(bool, x)) then it's possible
+ to build `Trie` from a range of open-right intervals of `Key`s.
The requirement on the ordering of keys (and the behavior on the
violation of it) is the same as for Key-Value range overload.
- Intervals denote ranges of !$(D filler) i.e. the opposite of filler.
+ Intervals denote ranges of !`filler` i.e. the opposite of filler.
If no filler provided keys inside of the intervals map to true,
- and $(D filler) is false.
+ and `filler` is false.
*/
auto buildTrie(Range)(Range range, Value filler=Value.init)
if(is(TypeOfBitPacked!Value == bool)
@@ -4456,13 +4456,13 @@ public template buildTrie(Value, Key, Args...)
}
/*
- If $(D Value) is bool (or BitPacked!(bool, x)) then it's possible
- to build $(D Trie) simply from an input range of $(D Key)s.
+ If `Value` is bool (or BitPacked!(bool, x)) then it's possible
+ to build `Trie` simply from an input range of `Key`s.
The requirement on the ordering of keys (and the behavior on the
violation of it) is the same as for Key-Value range overload.
- Keys found in range denote !$(D filler) i.e. the opposite of filler.
- If no filler provided keys map to true, and $(D filler) is false.
+ Keys found in range denote !`filler` i.e. the opposite of filler.
+ If no filler provided keys map to true, and `filler` is false.
*/
auto buildTrie(Range)(Range range, Value filler=Value.init)
if(is(TypeOfBitPacked!Value == bool)
@@ -4475,7 +4475,7 @@ public template buildTrie(Value, Key, Args...)
}
/*
- If $(D Key) is unsigned integer $(D Trie) could be constructed from array
+ If `Key` is unsigned integer `Trie` could be constructed from array
of values where array index serves as key.
*/
auto buildTrie()(Value[] array, Value filler=Value.init)
@@ -4488,7 +4488,7 @@ public template buildTrie(Value, Key, Args...)
}
/*
- Builds $(D Trie) from associative array.
+ Builds `Trie` from associative array.
*/
auto buildTrie(Key, Value)(Value[Key] map, Value filler=Value.init)
{
@@ -4524,12 +4524,12 @@ public struct MatcherConcept
{
/**
$(P Perform a semantic equivalent 2 operations:
- decoding a $(CODEPOINT) at front of $(D inp) and testing if
+ decoding a $(CODEPOINT) at front of `inp` and testing if
it belongs to the set of $(CODEPOINTS) of this matcher. )
- $(P The effect on $(D inp) depends on the kind of function called:)
+ $(P The effect on `inp` depends on the kind of function called:)
- $(P Match. If the codepoint is found in the set then range $(D inp)
+ $(P Match. If the codepoint is found in the set then range `inp`
is advanced by its size in $(S_LINK Code unit, code units),
otherwise the range is not modifed.)
@@ -4578,7 +4578,7 @@ public struct MatcherConcept
Advanced feature - provide direct access to a subset of matcher based a
set of known encoding lengths. Lengths are provided in
$(S_LINK Code unit, code units). The sub-matcher then may do less
- operations per any $(D test)/$(D match).
+ operations per any `test`/`match`.
Use with care as the sub-matcher won't match
any $(CODEPOINTS) that have encoded length that doesn't belong
@@ -4616,7 +4616,7 @@ public struct MatcherConcept
}
/**
- Test if $(D M) is an UTF Matcher for ranges of $(D Char).
+ Test if `M` is an UTF Matcher for ranges of `Char`.
*/
public enum isUtfMatcher(M, C) = __traits(compiles, (){
C[] s;
@@ -5195,8 +5195,8 @@ private auto utf16Matcher(Set)(Set set) @trusted
/**
Constructs a matcher object
- to classify $(CODEPOINTS) from the $(D set) for encoding
- that has $(D Char) as code unit.
+ to classify $(CODEPOINTS) from the `set` for encoding
+ that has `Char` as code unit.
See $(LREF MatcherConcept) for API outline.
*/
@@ -5242,7 +5242,7 @@ package auto decoder(C)(C[] s, size_t offset=0) @trusted
}
/*
- Expose UTF string $(D s) as a random-access
+ Expose UTF string `s` as a random-access
range of $(S_LINK Code unit, code units).
*/
package auto units(C)(C[] s)
@@ -5407,9 +5407,9 @@ unittest
/++
Convenience function to construct optimal configurations for
- packed Trie from any $(D set) of $(CODEPOINTS).
+ packed Trie from any `set` of $(CODEPOINTS).
- The parameter $(D level) indicates the number of trie levels to use,
+ The parameter `level` indicates the number of trie levels to use,
allowed values are: 1, 2, 3 or 4. Levels represent different trade-offs
speed-size wise.
@@ -5420,7 +5420,7 @@ unittest
Note:
Level 4 stays very practical (being faster and more predictable)
- compared to using direct lookup on the $(D set) itself.
+ compared to using direct lookup on the `set` itself.
+/
@@ -5441,7 +5441,7 @@ public auto toTrie(size_t level, Set)(Set set)
}
/**
- $(P Builds a $(D Trie) with typically optimal speed-size trade-off
+ $(P Builds a `Trie` with typically optimal speed-size trade-off
and wraps it into a delegate of the following type:
$(D bool delegate(dchar ch)). )
@@ -5461,15 +5461,15 @@ public auto toDelegate(Set)(Set set)
/**
$(P Opaque wrapper around unsigned built-in integers and
code unit (char/wchar/dchar) types.
- Parameter $(D sz) indicates that the value is confined
+ Parameter `sz` indicates that the value is confined
to the range of [0, 2^^sz$(RPAREN). With this knowledge it can be
packed more tightly when stored in certain
data-structures like trie. )
Note:
- $(P The $(D BitPacked!(T, sz)) is implicitly convertible to $(D T)
+ $(P The $(D BitPacked!(T, sz)) is implicitly convertible to `T`
but not vise-versa. Users have to ensure the value fits in
- the range required and use the $(D cast)
+ the range required and use the `cast`
operator to perform the conversion.)
*/
struct BitPacked(T, size_t sz)
@@ -5481,7 +5481,7 @@ struct BitPacked(T, size_t sz)
}
/*
- Depending on the form of the passed argument $(D bitSizeOf) returns
+ Depending on the form of the passed argument `bitSizeOf` returns
the amount of bits required to represent a given type
or a return type of a given functor.
*/
@@ -5504,7 +5504,7 @@ template bitSizeOf(Args...)
}
/**
- Tests if $(D T) is some instantiation of $(LREF BitPacked)!(U, x)
+ Tests if `T` is some instantiation of $(LREF BitPacked)!(U, x)
and thus suitable for packing.
*/
template isBitPacked(T)
@@ -5516,8 +5516,8 @@ template isBitPacked(T)
}
/**
- Gives the type $(D U) from $(LREF BitPacked)!(U, x)
- or $(D T) itself for every other type.
+ Gives the type `U` from $(LREF BitPacked)!(U, x)
+ or `T` itself for every other type.
*/
template TypeOfBitPacked(T)
{
@@ -5528,9 +5528,9 @@ template TypeOfBitPacked(T)
}
/*
- Wrapper, used in definition of custom data structures from $(D Trie) template.
+ Wrapper, used in definition of custom data structures from `Trie` template.
Applying it to a unary lambda function indicates that the returned value always
- fits within $(D bits) of bits.
+ fits within `bits` of bits.
*/
struct assumeSize(alias Fn, size_t bits)
{
@@ -5545,7 +5545,7 @@ struct assumeSize(alias Fn, size_t bits)
A helper for defining lambda function that yields a slice
of certain bits from an unsigned integral value.
The resulting lambda is wrapped in assumeSize and can be used directly
- with $(D Trie) template.
+ with `Trie` template.
*/
struct sliceBits(size_t from, size_t to)
{
@@ -5828,7 +5828,7 @@ unittest
assert(equalS(decompressIntervals(compressIntervals(run2)), run2));
}
-// Creates a range of $(D CodepointInterval) that lazily decodes compressed data.
+// Creates a range of `CodepointInterval` that lazily decodes compressed data.
@safe package auto decompressIntervals(const(ubyte)[] data) pure
{
return DecompressedIntervals(data);
@@ -6082,8 +6082,8 @@ template SetSearcher(alias table, string kind)
Note that since scripts and blocks overlap the
usual trick to disambiguate is used - to get a block use
- $(D unicode.InBlockName), to search a script
- use $(D unicode.ScriptName).
+ `unicode.InBlockName`, to search a script
+ use `unicode.ScriptName`.
See_Also: $(LREF block), $(LREF script)
and (not included in this search) $(LREF hangulSyllableType).
@@ -6120,7 +6120,7 @@ template SetSearcher(alias table, string kind)
/**
The same lookup across blocks, scripts, or binary properties,
but performed at run-time.
- This version is provided for cases where $(D name)
+ This version is provided for cases where `name`
is not known beforehand; otherwise compile-time
checked $(LREF opDispatch) is typically a better choice.
@@ -6138,7 +6138,7 @@ template SetSearcher(alias table, string kind)
Note:
Here block names are unambiguous as no scripts are searched
- and thus to search use simply $(D unicode.block.BlockName) notation.
+ and thus to search use simply `unicode.block.BlockName` notation.
See $(S_LINK Unicode properties, table of properties) for available sets.
@@ -6183,8 +6183,8 @@ template SetSearcher(alias table, string kind)
Fetch a set of $(CODEPOINTS) that have the given hangul syllable type.
Other non-binary properties (once supported) follow the same
- notation - $(D unicode.propertyName.propertyValue) for compile-time
- checked access and $(D unicode.propertyName(propertyValue))
+ notation - `unicode.propertyName.propertyValue` for compile-time
+ checked access and `unicode.propertyName(propertyValue)`
for run-time checked one.
See the $(S_LINK Unicode properties, table of properties) for available
@@ -6421,8 +6421,8 @@ template genericDecodeGrapheme(bool getValue)
public: // Public API continues
/++
- Returns the length of grapheme cluster starting at $(D index).
- Both the resulting length and the $(D index) are measured
+ Returns the length of grapheme cluster starting at `index`.
+ Both the resulting length and the `index` are measured
in $(S_LINK Code unit, code units).
Example:
@@ -6459,12 +6459,12 @@ unittest
}
/++
- Reads one full grapheme cluster from an input range of dchar $(D inp).
+ Reads one full grapheme cluster from an input range of dchar `inp`.
For examples see the $(LREF Grapheme) below.
Note:
- This function modifies $(D inp) and thus $(D inp)
+ This function modifies `inp` and thus `inp`
must be an L-value.
+/
Grapheme decodeGrapheme(Input)(ref Input inp)
@@ -6690,8 +6690,8 @@ unittest
of a $(CLUSTER).
)
- $(P $(D Grapheme) has value semantics so 2 copies of a $(D Grapheme)
- always refer to distinct objects. In most actual scenarios a $(D Grapheme)
+ $(P `Grapheme` has value semantics so 2 copies of a `Grapheme`
+ always refer to distinct objects. In most actual scenarios a `Grapheme`
fits on the stack and avoids memory allocation overhead for all but quite
long clusters.
)
@@ -6742,7 +6742,7 @@ public:
}
/++
- Writes a $(CODEPOINT) $(D ch) at given index in this cluster.
+ Writes a $(CODEPOINT) `ch` at given index in this cluster.
Warning:
Use of this facility may invalidate grapheme cluster,
@@ -6788,10 +6788,10 @@ public:
}
/++
- Append $(CHARACTER) $(D ch) to this grapheme.
+ Append $(CHARACTER) `ch` to this grapheme.
Warning:
Use of this facility may invalidate grapheme cluster,
- see also $(D valid).
+ see also `valid`.
Example:
---
@@ -6837,7 +6837,7 @@ public:
static assert(false, "No operation "~op~" defined for Grapheme");
}
- /// Append all $(CHARACTERS) from the input range $(D inp) to this Grapheme.
+ /// Append all $(CHARACTERS) from the input range `inp` to this Grapheme.
ref opOpAssign(string op, Input)(Input inp)
if(isInputRange!Input && is(ElementType!Input : dchar))
{
@@ -6853,7 +6853,7 @@ public:
/++
True if this object contains valid extended grapheme cluster.
- Decoding primitives of this module always return a valid $(D Grapheme).
+ Decoding primitives of this module always return a valid `Grapheme`.
Appending to and direct manipulation of grapheme's $(CHARACTERS) may
render it no longer valid. Certain applications may chose to use
@@ -7032,7 +7032,7 @@ unittest
}
/++
- $(P Does basic case-insensitive comparison of strings $(D str1) and $(D str2).
+ $(P Does basic case-insensitive comparison of strings `str1` and `str2`.
This function uses simpler comparison rule thus achieving better performance
then $(LREF icmp). However keep in mind the warning below.)
@@ -7147,11 +7147,11 @@ private int fullCasedCmp(Range)(dchar lhs, dchar rhs, ref Range rtail)
}
/++
- $(P Does case insensitive comparison of $(D str1) and $(D str2).
+ $(P Does case insensitive comparison of `str1` and `str2`.
Follows the rules of full case-folding mapping.
This includes matching as equal german ß with "ss" and
other 1:M $(CODEPOINT) mappings unlike $(LREF sicmp).
- The cost of $(D icmp) being pedantically correct is
+ The cost of `icmp` being pedantically correct is
slightly worse performance.
)
@@ -7247,7 +7247,7 @@ unittest
// It needs a better API
/*
Return a range of all $(CODEPOINTS) that casefold to
- and from this $(D ch).
+ and from this `ch`.
*/
package auto simpleCaseFoldings(dchar ch)
{
@@ -7342,7 +7342,7 @@ unittest
}
/++
- $(P Returns the $(S_LINK Combining class, combining class) of $(D ch).)
+ $(P Returns the $(S_LINK Combining class, combining class) of `ch`.)
Example:
---
@@ -7397,11 +7397,11 @@ enum {
Try to canonically compose 2 $(CHARACTERS).
Returns the composed $(CHARACTER) if they do compose and dchar.init otherwise.
- The assumption is that $(D first) comes before $(D second) in the original text,
+ The assumption is that `first` comes before `second` in the original text,
usually meaning that the first is a starter.
Note: Hangul syllables are not covered by this function.
- See $(D composeJamo) below.
+ See `composeJamo` below.
Example:
---
@@ -7437,9 +7437,9 @@ public dchar compose(dchar first, dchar second) pure nothrow
/++
Returns a full $(S_LINK Canonical decomposition, Canonical)
(by default) or $(S_LINK Compatibility decomposition, Compatibility)
- decomposition of $(CHARACTER) $(D ch).
+ decomposition of $(CHARACTER) `ch`.
If no decomposition is available returns a $(LREF Grapheme)
- with the $(D ch) itself.
+ with the `ch` itself.
Note:
This function also decomposes hangul syllables
@@ -7506,14 +7506,14 @@ enum jamoLCount = 19, jamoVCount = 21, jamoTCount = 28;
enum jamoNCount = jamoVCount * jamoTCount;
enum jamoSCount = jamoLCount * jamoNCount;
-// Tests if $(D ch) is a Hangul leading consonant jamo.
+// Tests if `ch` is a Hangul leading consonant jamo.
bool isJamoL(dchar ch) pure nothrow @nogc
{
// first cmp rejects ~ 1M code points above leading jamo range
return ch < jamoLBase+jamoLCount && ch >= jamoLBase;
}
-// Tests if $(D ch) is a Hangul vowel jamo.
+// Tests if `ch` is a Hangul vowel jamo.
bool isJamoT(dchar ch) pure nothrow @nogc
{
// first cmp rejects ~ 1M code points above trailing jamo range
@@ -7521,7 +7521,7 @@ bool isJamoT(dchar ch) pure nothrow @nogc
return ch < jamoTBase+jamoTCount && ch > jamoTBase;
}
-// Tests if $(D ch) is a Hangul trailnig consonant jamo.
+// Tests if `ch` is a Hangul trailnig consonant jamo.
bool isJamoV(dchar ch) pure nothrow @nogc
{
// first cmp rejects ~ 1M code points above vowel range
@@ -7567,8 +7567,8 @@ void hangulRecompose(dchar[] seq) pure nothrow @nogc
public:
/**
- Decomposes a Hangul syllable. If $(D ch) is not a composed syllable
- then this function returns $(LREF Grapheme) containing only $(D ch) as is.
+ Decomposes a Hangul syllable. If `ch` is not a composed syllable
+ then this function returns $(LREF Grapheme) containing only `ch` as is.
Example:
---
@@ -7593,12 +7593,12 @@ Grapheme decomposeHangul(dchar ch)
}
/++
- Try to compose hangul syllable out of a leading consonant ($(D lead)),
- a $(D vowel) and optional $(D trailing) consonant jamos.
+ Try to compose hangul syllable out of a leading consonant (`lead`),
+ a `vowel` and optional `trailing` consonant jamos.
On success returns the composed LV or LVT hangul syllable.
- If any of $(D lead) and $(D vowel) are not a valid hangul jamo
+ If any of `lead` and `vowel` are not a valid hangul jamo
of the respective $(CHARACTER) class returns dchar.init.
Example:
@@ -7674,7 +7674,7 @@ enum {
};
/++
- Returns $(D input) string normalized to the chosen form.
+ Returns `input` string normalized to the chosen form.
Form C is used by default.
For more information on normalization forms see
@@ -7930,8 +7930,8 @@ private auto seekStable(NormalizationForm norm, C)(size_t idx, in C[] input)
}
/**
- Tests if dchar $(D ch) is always allowed (Quick_Check=YES) in normalization
- form $(D norm).
+ Tests if dchar `ch` is always allowed (Quick_Check=YES) in normalization
+ form `norm`.
---
// e.g. Cyrillic is always allowed, so is ASCII
assert(allowedIn!NFC('я'));
@@ -8010,7 +8010,7 @@ else
public:
/++
- Whether or not $(D c) is a Unicode whitespace $(CHARACTER).
+ Whether or not `c` is a Unicode whitespace $(CHARACTER).
(general Unicode category: Part of C0(tab, vertical tab, form feed,
carriage return, and linefeed characters), Zs, Zl, Zp, and NEL(U+0085))
+/
@@ -8021,7 +8021,7 @@ public bool isWhite(dchar c)
}
/++
- Return whether $(D c) is a Unicode lowercase $(CHARACTER).
+ Return whether `c` is a Unicode lowercase $(CHARACTER).
+/
@safe pure nothrow @nogc
bool isLower(dchar c)
@@ -8054,7 +8054,7 @@ bool isLower(dchar c)
/++
- Return whether $(D c) is a Unicode uppercase $(CHARACTER).
+ Return whether `c` is a Unicode uppercase $(CHARACTER).
+/
@safe pure nothrow @nogc
bool isUpper(dchar c)
@@ -8086,8 +8086,8 @@ bool isUpper(dchar c)
/++
- If $(D c) is a Unicode uppercase $(CHARACTER), then its lowercase equivalent
- is returned. Otherwise $(D c) is returned.
+ If `c` is a Unicode uppercase $(CHARACTER), then its lowercase equivalent
+ is returned. Otherwise `c` is returned.
Warning: certain alphabets like German and Greek have no 1:1
upper-lower mapping. Use overload of toLower which takes full string instead.
@@ -8433,10 +8433,10 @@ private template toCaseInPlaceAlloc(alias indexFn, uint maxIdx, alias tableFn)
}
/++
- Converts $(D s) to lowercase (by performing Unicode lowercase mapping) in place.
+ Converts `s` to lowercase (by performing Unicode lowercase mapping) in place.
For a few characters string length may increase after the transformation,
in such a case the function reallocates exactly once.
- If $(D s) does not have any uppercase characters, then $(D s) is unaltered.
+ If `s` does not have any uppercase characters, then `s` is unaltered.
+/
void toLowerInPlace(C)(ref C[] s) @trusted pure
if (is(C == char) || is(C == wchar) || is(C == dchar))
@@ -8455,10 +8455,10 @@ void toLowerInPlace(C)(ref C[] s) @trusted pure
}
/++
- Converts $(D s) to uppercase (by performing Unicode uppercase mapping) in place.
+ Converts `s` to uppercase (by performing Unicode uppercase mapping) in place.
For a few characters string length may increase after the transformation,
in such a case the function reallocates exactly once.
- If $(D s) does not have any lowercase characters, then $(D s) is unaltered.
+ If `s` does not have any lowercase characters, then `s` is unaltered.
+/
void toUpperInPlace(C)(ref C[] s) @trusted pure
if (is(C == char) || is(C == wchar) || is(C == dchar))
@@ -8477,9 +8477,9 @@ void toUpperInPlace(C)(ref C[] s) @trusted pure
}
/++
- Returns a string which is identical to $(D s) except that all of its
+ Returns a string which is identical to `s` except that all of its
characters are converted to lowercase (by preforming Unicode lowercase mapping).
- If none of $(D s) characters were affected, then $(D s) itself is returned.
+ If none of `s` characters were affected, then `s` itself is returned.
+/
S toLower(S)(S s) @trusted pure
if(isSomeString!S)
@@ -8578,8 +8578,8 @@ unittest
/++
- If $(D c) is a Unicode lowercase $(CHARACTER), then its uppercase equivalent
- is returned. Otherwise $(D c) is returned.
+ If `c` is a Unicode lowercase $(CHARACTER), then its uppercase equivalent
+ is returned. Otherwise `c` is returned.
Warning:
Certain alphabets like German and Greek have no 1:1
@@ -8639,9 +8639,9 @@ unittest
}
/++
- Returns a string which is identical to $(D s) except that all of its
+ Returns a string which is identical to `s` except that all of its
characters are converted to uppercase (by preforming Unicode uppercase mapping).
- If none of $(D s) characters were affected, then $(D s) itself is returned.
+ If none of `s` characters were affected, then `s` itself is returned.
+/
S toUpper(S)(S s) @trusted pure
if(isSomeString!S)
@@ -8747,7 +8747,7 @@ unittest
/++
- Returns whether $(D c) is a Unicode alphabetic $(CHARACTER)
+ Returns whether `c` is a Unicode alphabetic $(CHARACTER)
(general Unicode category: Alphabetic).
+/
@safe pure nothrow @nogc
@@ -8782,7 +8782,7 @@ bool isAlpha(dchar c)
/++
- Returns whether $(D c) is a Unicode mark
+ Returns whether `c` is a Unicode mark
(general Unicode category: Mn, Me, Mc).
+/
@safe pure nothrow @nogc
@@ -8801,7 +8801,7 @@ bool isMark(dchar c)
}
/++
- Returns whether $(D c) is a Unicode numerical $(CHARACTER)
+ Returns whether `c` is a Unicode numerical $(CHARACTER)
(general Unicode category: Nd, Nl, No).
+/
@safe pure nothrow @nogc
@@ -8821,7 +8821,7 @@ bool isNumber(dchar c)
/++
- Returns whether $(D c) is a Unicode punctuation $(CHARACTER)
+ Returns whether `c` is a Unicode punctuation $(CHARACTER)
(general Unicode category: Pd, Ps, Pe, Pc, Po, Pi, Pf).
+/
@safe pure nothrow @nogc
@@ -8844,7 +8844,7 @@ unittest
}
/++
- Returns whether $(D c) is a Unicode symbol $(CHARACTER)
+ Returns whether `c` is a Unicode symbol $(CHARACTER)
(general Unicode category: Sm, Sc, Sk, So).
+/
@safe pure nothrow @nogc
@@ -8865,7 +8865,7 @@ unittest
}
/++
- Returns whether $(D c) is a Unicode space $(CHARACTER)
+ Returns whether `c` is a Unicode space $(CHARACTER)
(general Unicode category: Zs)
Note: This doesn't include '\n', '\r', \t' and other non-space $(CHARACTER).
For commonly used less strict semantics see $(LREF isWhite).
@@ -8888,7 +8888,7 @@ unittest
/++
- Returns whether $(D c) is a Unicode graphical $(CHARACTER)
+ Returns whether `c` is a Unicode graphical $(CHARACTER)
(general Unicode category: L, M, N, P, S, Zs).
+/
@@ -8911,7 +8911,7 @@ unittest
/++
- Returns whether $(D c) is a Unicode control $(CHARACTER)
+ Returns whether `c` is a Unicode control $(CHARACTER)
(general Unicode category: Cc).
+/
@safe pure nothrow @nogc
@@ -8934,7 +8934,7 @@ unittest
/++
- Returns whether $(D c) is a Unicode formatting $(CHARACTER)
+ Returns whether `c` is a Unicode formatting $(CHARACTER)
(general Unicode category: Cf).
+/
@safe pure nothrow @nogc
@@ -8955,7 +8955,7 @@ unittest
// if need be they can be generated from unicode data as well
/++
- Returns whether $(D c) is a Unicode Private Use $(CODEPOINT)
+ Returns whether `c` is a Unicode Private Use $(CODEPOINT)
(general Unicode category: Co).
+/
@safe pure nothrow @nogc
@@ -8967,7 +8967,7 @@ bool isPrivateUse(dchar c)
}
/++
- Returns whether $(D c) is a Unicode surrogate $(CODEPOINT)
+ Returns whether `c` is a Unicode surrogate $(CODEPOINT)
(general Unicode category: Cs).
+/
@safe pure nothrow @nogc
@@ -8977,7 +8977,7 @@ bool isSurrogate(dchar c)
}
/++
- Returns whether $(D c) is a Unicode high surrogate (lead surrogate).
+ Returns whether `c` is a Unicode high surrogate (lead surrogate).
+/
@safe pure nothrow @nogc
bool isSurrogateHi(dchar c)
@@ -8986,7 +8986,7 @@ bool isSurrogateHi(dchar c)
}
/++
- Returns whether $(D c) is a Unicode low surrogate (trail surrogate).
+ Returns whether `c` is a Unicode low surrogate (trail surrogate).
+/
@safe pure nothrow @nogc
bool isSurrogateLo(dchar c)
@@ -8995,7 +8995,7 @@ bool isSurrogateLo(dchar c)
}
/++
- Returns whether $(D c) is a Unicode non-character i.e.
+ Returns whether `c` is a Unicode non-character i.e.
a $(CODEPOINT) with no assigned abstract character.
(general Unicode category: Cn)
+/
diff --git a/std/utf.d b/std/utf.d
index 2b0642c19a7..420b031bafb 100644
--- a/std/utf.d
+++ b/std/utf.d
@@ -85,9 +85,9 @@ class UTFException : Exception
/++
- Returns whether $(D c) is a valid UTF-32 character.
+ Returns whether `c` is a valid UTF-32 character.
- $(D '\uFFFE') and $(D '\uFFFF') are considered valid by $(D isValidDchar),
+ `'\uFFFE'` and `'\uFFFF'` are considered valid by `isValidDchar`,
as they are permitted for internal use by an application, but they are
not allowed for interchange by the Unicode standard.
+/
@@ -128,25 +128,25 @@ unittest
/++
- $(D stride) returns the length of the UTF-8 sequence starting at $(D index)
- in $(D str).
+ `stride` returns the length of the UTF-8 sequence starting at `index`
+ in `str`.
- $(D stride) works with both UTF-8 strings and ranges of $(D char). If no
+ `stride` works with both UTF-8 strings and ranges of `char`. If no
index is passed, then an input range will work, but if an index is passed,
then a random-access range is required.
- $(D index) defaults to $(D 0) if none is passed.
+ `index` defaults to `0` if none is passed.
Returns:
The number of bytes in the UTF-8 sequence, a value between 1 and 4
(as per $(WEB tools.ietf.org/html/rfc3629#section-3, RFC 3629$(COMMA) section 3)).
Throws:
- May throw a $(D UTFException) if $(D str[index]) is not the start of a
+ May throw a `UTFException` if `str[index]` is not the start of a
valid UTF-8 sequence.
Notes:
- $(D stride) will only analyze the first $(D str[index]) element. It
+ `stride` will only analyze the first `str[index]` element. It
will not fully verify the validity of UTF-8 sequence, nor even verify
the presence of the sequence: it will not actually guarantee that
$(D index + stride(str, index) <= str.length).
@@ -275,24 +275,24 @@ unittest // invalid start bytes
/++
- $(D strideBack) returns the length of the UTF-8 sequence ending one code
- unit before $(D index) in $(D str).
+ `strideBack` returns the length of the UTF-8 sequence ending one code
+ unit before `index` in `str`.
- $(D strideBack) works with both UTF-8 strings and bidirectional ranges of
- $(D char). If no index is passed, then a bidirectional range will work, but
+ `strideBack` works with both UTF-8 strings and bidirectional ranges of
+ `char`. If no index is passed, then a bidirectional range will work, but
if an index is passed, then a random-access range is required.
- $(D index) defaults to $(D str.length) if none is passed.
+ `index` defaults to `str.length` if none is passed.
Returns:
The number of bytes in the UTF-8 sequence.
Throws:
- May throw a $(D UTFException) if $(D str[index]) is not one past the
+ May throw a `UTFException` if `str[index]` is not one past the
end of a valid UTF-8 sequence.
Notes:
- $(D strideBack) will not fully verify the validity of the UTF-8
+ `strideBack` will not fully verify the validity of the UTF-8
sequence. It will, however, guarantee that
$(D index - stride(str, index)) is a valid index.
+/
@@ -419,24 +419,24 @@ unittest
/++
- $(D stride) returns the length of the UTF-16 sequence starting at $(D index)
- in $(D str).
+ `stride` returns the length of the UTF-16 sequence starting at `index`
+ in `str`.
- $(D stride) works with both UTF-16 strings and ranges of $(D wchar). If no
+ `stride` works with both UTF-16 strings and ranges of `wchar`. If no
index is passed, then an input range will work, but if an index is passed,
then a random-access range is required.
- $(D index) defaults to $(D 0) if none is passed.
+ `index` defaults to `0` if none is passed.
Returns:
The number of bytes in the UTF-16 sequence.
Throws:
- May throw a $(D UTFException) if $(D str[index]) is not the start of a
+ May throw a `UTFException` if `str[index]` is not the start of a
valid UTF-16 sequence.
Notes:
- $(D stride) will only analyze the first $(D str[index]) element. It
+ `stride` will only analyze the first `str[index]` element. It
will not fully verify the validity of UTF-16 sequence, nor even verify
the presence of the sequence: it will not actually guarantee that
$(D index + stride(str, index) <= str.length).
@@ -535,24 +535,24 @@ uint stride(S)(auto ref S str)
/++
- $(D strideBack) returns the length of the UTF-16 sequence ending one code
- unit before $(D index) in $(D str).
+ `strideBack` returns the length of the UTF-16 sequence ending one code
+ unit before `index` in `str`.
- $(D strideBack) works with both UTF-16 strings and ranges of $(D wchar). If
+ `strideBack` works with both UTF-16 strings and ranges of `wchar`. If
no index is passed, then a bidirectional range will work, but if an index is
passed, then a random-access range is required.
- $(D index) defaults to $(D str.length) if none is passed.
+ `index` defaults to `str.length` if none is passed.
Returns:
The number of bytes in the UTF-16 sequence.
Throws:
- May throw a $(D UTFException) if $(D str[index]) is not one past the
+ May throw a `UTFException` if `str[index]` is not one past the
end of a valid UTF-16 sequence.
Notes:
- $(D stride) will only analyze the element at $(D str[index - 1])
+ `stride` will only analyze the element at $(D str[index - 1])
element. It will not fully verify the validity of UTF-16 sequence, nor
even verify the presence of the sequence: it will not actually
guarantee that $(D stride(str, index) <= index).
@@ -655,13 +655,13 @@ unittest
/++
- $(D stride) returns the length of the UTF-32 sequence starting at $(D index)
- in $(D str).
+ `stride` returns the length of the UTF-32 sequence starting at `index`
+ in `str`.
- $(D stride) works with both UTF-32 strings and ranges of $(D dchar).
+ `stride` works with both UTF-32 strings and ranges of `dchar`.
Returns:
- The number of bytes in the UTF-32 sequence (always $(D 1)).
+ The number of bytes in the UTF-32 sequence (always `1`).
Throws:
Never.
@@ -746,17 +746,17 @@ unittest
/++
- $(D strideBack) returns the length of the UTF-32 sequence ending one code
- unit before $(D index) in $(D str).
+ `strideBack` returns the length of the UTF-32 sequence ending one code
+ unit before `index` in `str`.
- $(D strideBack) works with both UTF-32 strings and ranges of $(D dchar). If
+ `strideBack` works with both UTF-32 strings and ranges of `dchar`. If
no index is passed, then a bidirectional range will work, but if an index is
passed, then a random-access range is required.
- $(D index) defaults to $(D str.length) if none is passed.
+ `index` defaults to `str.length` if none is passed.
Returns:
- The number of bytes in the UTF-32 sequence (always $(D 1)).
+ The number of bytes in the UTF-32 sequence (always `1`).
Throws:
Never.
@@ -847,9 +847,9 @@ unittest
/++
- Given $(D index) into $(D str) and assuming that $(D index) is at the start
- of a UTF sequence, $(D toUCSindex) determines the number of UCS characters
- up to $(D index). So, $(D index) is the index of a code unit at the
+ Given `index` into `str` and assuming that `index` is at the start
+ of a UTF sequence, `toUCSindex` determines the number of UCS characters
+ up to `index`. So, `index` is the index of a code unit at the
beginning of a code point, and the return value is how many code points into
the string that that code point is.
+/
@@ -896,8 +896,8 @@ unittest
/++
- Given a UCS index $(D n) into $(D str), returns the UTF index.
- So, $(D n) is how many code points into the string the code point is, and
+ Given a UCS index `n` into `str`, returns the UTF index.
+ So, `n` is how many code points into the string the code point is, and
the array index of the code unit is returned.
+/
size_t toUTFindex(C)(const(C)[] str, size_t n) @safe pure
@@ -938,9 +938,9 @@ unittest
/* =================== Decode ======================= */
/++
- Decodes and returns the code point starting at $(D str[index]). $(D index)
+ Decodes and returns the code point starting at `str[index]`. `index`
is advanced to one past the decoded code point. If the code point is not
- well-formed, then a $(D UTFException) is thrown and $(D index) remains
+ well-formed, then a `UTFException` is thrown and `index` remains
unchanged.
decode will only work with strings and random access ranges of code units
@@ -948,7 +948,7 @@ unittest
input range of code units.
Throws:
- $(LREF UTFException) if $(D str[index]) is not the start of a valid UTF
+ $(LREF UTFException) if `str[index]` is not the start of a valid UTF
sequence.
+/
dchar decode(S)(auto ref S str, ref size_t index)
@@ -989,15 +989,15 @@ body
}
/++
- $(D decodeFront) is a variant of $(LREF decode) which specifically decodes
- the first code point. Unlike $(LREF decode), $(D decodeFront) accepts any
+ `decodeFront` is a variant of $(LREF decode) which specifically decodes
+ the first code point. Unlike $(LREF decode), `decodeFront` accepts any
input range of code units (rather than just a string or random access
- range). It also takes the range by $(D ref) and pops off the elements as it
- decodes them. If $(D numCodeUnits) is passed in, it gets set to the number
+ range). It also takes the range by `ref` and pops off the elements as it
+ decodes them. If `numCodeUnits` is passed in, it gets set to the number
of code units which were in the code point which was decoded.
Throws:
- $(LREF UTFException) if $(D str.front) is not the start of a valid UTF
+ $(LREF UTFException) if `str.front` is not the start of a valid UTF
sequence. If an exception is thrown, then there is no guarantee as to
the number of code units which were popped off, as it depends on the
type of range being used and how many code units had to be popped off
@@ -1597,13 +1597,13 @@ unittest
/* =================== Encode ======================= */
/++
- Encodes $(D c) into the static array, $(D buf), and returns the actual
- length of the encoded character (a number between $(D 1) and $(D 4) for
- $(D char[4]) buffers and a number between $(D 1) and $(D 2) for
- $(D wchar[2]) buffers).
+ Encodes `c` into the static array, `buf`, and returns the actual
+ length of the encoded character (a number between `1` and `4` for
+ `char[4]` buffers and a number between `1` and `2` for
+ `wchar[2]` buffers).
Throws:
- $(D UTFException) if $(D c) is not a valid UTF code point.
+ `UTFException` if `c` is not a valid UTF code point.
+/
size_t encode(ref char[4] buf, dchar c) @safe pure
{
@@ -1722,10 +1722,10 @@ unittest
/++
- Encodes $(D c) in $(D str)'s encoding and appends it to $(D str).
+ Encodes `c` in `str`'s encoding and appends it to `str`.
Throws:
- $(D UTFException) if $(D c) is not a valid UTF code point.
+ `UTFException` if `c` is not a valid UTF code point.
+/
void encode(ref char[] str, dchar c) @safe pure
{
@@ -1917,7 +1917,7 @@ unittest
/++
Returns the number of code units that are required to encode the code point
- $(D c) when $(D C) is the character type used to encode it.
+ `c` when `C` is the character type used to encode it.
+/
ubyte codeLength(C)(dchar c) @safe pure nothrow @nogc
if (isSomeChar!C)
@@ -1955,8 +1955,8 @@ pure nothrow @nogc unittest
/++
- Returns the number of code units that are required to encode $(D str)
- in a string whose character type is $(D C). This is particularly useful
+ Returns the number of code units that are required to encode `str`
+ in a string whose character type is `C`. This is particularly useful
when slicing one string with the length of another and the two string
types use different character types.
+/
@@ -2029,11 +2029,11 @@ unittest
/+
Internal helper function:
-Returns true if it is safe to search for the Codepoint $(D c) inside
+Returns true if it is safe to search for the Codepoint `c` inside
code units, without decoding.
This is a runtime check that is used an optimization in various functions,
-particularly, in $(D std.string).
+particularly, in `std.string`.
+/
package bool canSearchInCodeUnits(C)(dchar c)
if (isSomeChar!C)
@@ -2069,10 +2069,10 @@ unittest
/* =================== Validation ======================= */
/++
- Checks to see if $(D str) is well-formed unicode or not.
+ Checks to see if `str` is well-formed unicode or not.
Throws:
- $(D UTFException) if $(D str) is not well-formed.
+ `UTFException` if `str` is not well-formed.
+/
void validate(S)(in S str) @safe pure
if (isSomeString!S)
@@ -2228,7 +2228,7 @@ body
}
/****************
- * Encodes string $(D s) into UTF-16 and returns the encoded string.
+ * Encodes string `s` into UTF-16 and returns the encoded string.
*/
wstring toUTF16(in char[] s) @trusted
{
@@ -2346,36 +2346,36 @@ dstring toUTF32(in dchar[] s) @safe
/* =================== toUTFz ======================= */
/++
- Returns a C-style zero-terminated string equivalent to $(D str). $(D str)
- must not contain embedded $(D '\0')'s as any C function will treat the first
- $(D '\0') that it sees as the end of the string. If $(D str.empty) is
- $(D true), then a string containing only $(D '\0') is returned.
+ Returns a C-style zero-terminated string equivalent to `str`. `str`
+ must not contain embedded `'\0'`'s as any C function will treat the first
+ `'\0'` that it sees as the end of the string. If `str.empty` is
+ `true`, then a string containing only `'\0'` is returned.
- $(D toUTFz) accepts any type of string and is templated on the type of
+ `toUTFz` accepts any type of string and is templated on the type of
character pointer that you wish to convert to. It will avoid allocating a
new string if it can, but there's a decent chance that it will end up having
to allocate a new string - particularly when dealing with character types
- other than $(D char).
+ other than `char`.
- $(RED Warning 1:) If the result of $(D toUTFz) equals $(D str.ptr), then if
- anything alters the character one past the end of $(D str) (which is the
- $(D '\0') character terminating the string), then the string won't be
+ $(RED Warning 1:) If the result of `toUTFz` equals `str.ptr`, then if
+ anything alters the character one past the end of `str` (which is the
+ `'\0'` character terminating the string), then the string won't be
zero-terminated anymore. The most likely scenarios for that are if you
- append to $(D str) and no reallocation takes place or when $(D str) is a
+ append to `str` and no reallocation takes place or when `str` is a
slice of a larger array, and you alter the character in the larger array
- which is one character past the end of $(D str). Another case where it could
+ which is one character past the end of `str`. Another case where it could
occur would be if you had a mutable character array immediately after
- $(D str) in memory (for example, if they're member variables in a
+ `str` in memory (for example, if they're member variables in a
user-defined type with one declared right after the other) and that
- character array happened to start with $(D '\0'). Such scenarios will never
+ character array happened to start with `'\0'`. Such scenarios will never
occur if you immediately use the zero-terminated string after calling
- $(D toUTFz) and the C function using it doesn't keep a reference to it.
+ `toUTFz` and the C function using it doesn't keep a reference to it.
Also, they are unlikely to occur even if you save the zero-terminated string
(the cases above would be among the few examples of where it could happen).
However, if you save the zero-terminate string and want to be absolutely
certain that the string stays zero-terminated, then simply append a
- $(D '\0') to the string and use its $(D ptr) property rather than calling
- $(D toUTFz).
+ `'\0'` to the string and use its `ptr` property rather than calling
+ `toUTFz`.
$(RED Warning 2:) When passing a character pointer to a C function, and the
C function keeps it around for any reason, make sure that you keep a
@@ -2589,11 +2589,11 @@ private P toUTFzImpl(P, S)(S str) @safe pure
/++
- $(D toUTF16z) is a convenience function for $(D toUTFz!(const(wchar)*)).
+ `toUTF16z` is a convenience function for $(D toUTFz!(const(wchar)*)).
- Encodes string $(D s) into UTF-16 and returns the encoded string.
- $(D toUTF16z) is suitable for calling the 'W' functions in the Win32 API
- that take an $(D LPWSTR) or $(D LPCWSTR) argument.
+ Encodes string `s` into UTF-16 and returns the encoded string.
+ `toUTF16z` is suitable for calling the 'W' functions in the Win32 API
+ that take an `LPWSTR` or `LPCWSTR` argument.
+/
const(wchar)* toUTF16z(C)(const(C)[] str) @safe pure
if (isSomeChar!C)
@@ -2645,14 +2645,14 @@ pure unittest
/++
- Returns the total number of code points encoded in $(D str).
+ Returns the total number of code points encoded in `str`.
Supercedes: This function supercedes $(LREF toUCSindex).
Standards: Unicode 5.0, ASCII, ISO-8859-1, WINDOWS-1252
Throws:
- $(D UTFException) if $(D str) is not well-formed.
+ `UTFException` if `str` is not well-formed.
+/
size_t count(C)(const(C)[] str) @trusted pure nothrow @nogc
if (isSomeChar!C)
diff --git a/std/uuid.d b/std/uuid.d
index dc0acab2357..bba712591de 100644
--- a/std/uuid.d
+++ b/std/uuid.d
@@ -50,7 +50,7 @@ $(MYREF oidNamespace) $(MYREF x500Namespace) )
*
* For efficiency, UUID is implemented as a struct. UUIDs are therefore empty if not explicitly
* initialized. An UUID is empty if $(MYREF3 UUID.empty, empty) is true. Empty UUIDs are equal to
- * $(D UUID.init), which is a UUID with all 16 bytes set to 0.
+ * `UUID.init`, which is a UUID with all 16 bytes set to 0.
* Use UUID's constructors or the UUID generator functions to get an initialized UUID.
*
* This is a port of $(LINK2 http://www.boost.org/doc/libs/1_42_0/libs/uuid/uuid.html,
@@ -171,7 +171,7 @@ public struct UUID
*
* Note:
* All of these UUID versions can be read and processed by
- * $(D std.uuid), but only version 3, 4 and 5 UUIDs can be generated.
+ * `std.uuid`, but only version 3, 4 and 5 UUIDs can be generated.
*/
enum Version
{
@@ -809,7 +809,7 @@ public struct UUID
/**
* This function generates a name based (Version 3) UUID from a namespace UUID and a name.
- * If no namespace UUID was passed, the empty UUID $(D UUID.init) is used.
+ * If no namespace UUID was passed, the empty UUID `UUID.init` is used.
*
* Note:
* The default namespaces ($(LREF dnsNamespace), ...) defined by
@@ -835,8 +835,8 @@ public struct UUID
* RFC 4122 isn't very clear on how UUIDs should be generated from names.
* It is possible that different implementations return different UUIDs
* for the same input, so be warned. The implementation for UTF-8 strings
- * and byte arrays used by $(D std.uuid) is compatible with Boost's implementation.
- * $(D std.uuid) guarantees that the same input to this function will generate
+ * and byte arrays used by `std.uuid` is compatible with Boost's implementation.
+ * `std.uuid` guarantees that the same input to this function will generate
* the same output at any time, on any system (this especially means endianness
* doesn't matter).
*
@@ -924,7 +924,7 @@ public struct UUID
/**
* This function generates a name based (Version 5) UUID from a namespace
* UUID and a name.
- * If no namespace UUID was passed, the empty UUID $(D UUID.init) is used.
+ * If no namespace UUID was passed, the empty UUID `UUID.init` is used.
*
* Note:
* The default namespaces ($(LREF dnsNamespace), ...) defined by
@@ -947,8 +947,8 @@ public struct UUID
* RFC 4122 isn't very clear on how UUIDs should be generated from names.
* It is possible that different implementations return different UUIDs
* for the same input, so be warned. The implementation for UTF-8 strings
- * and byte arrays used by $(D std.uuid) is compatible with Boost's implementation.
- * $(D std.uuid) guarantees that the same input to this function will generate
+ * and byte arrays used by `std.uuid` is compatible with Boost's implementation.
+ * `std.uuid` guarantees that the same input to this function will generate
* the same output at any time, on any system (this especially means endianness
* doesn't matter).
*
diff --git a/std/variant.d b/std/variant.d
index 6d8cb236c76..4c25dc3ffae 100644
--- a/std/variant.d
+++ b/std/variant.d
@@ -71,7 +71,7 @@ import core.stdc.string, std.conv, std.exception, std.traits, std.typecons,
@trusted:
/++
- Gives the $(D sizeof) the largest type given.
+ Gives the `sizeof` the largest type given.
+/
template maxSize(T...)
{
@@ -1194,7 +1194,7 @@ public:
}
/**
- If the $(D VariantN) contains an array, applies $(D dg) to each
+ If the `VariantN` contains an array, applies `dg` to each
element of the array in turn. Otherwise, throws an exception.
*/
int opApply(Delegate)(scope Delegate dg) if (is(Delegate == delegate))
diff --git a/std/windows/registry.d b/std/windows/registry.d
index 4823f3a7561..1800d83a132 100644
--- a/std/windows/registry.d
+++ b/std/windows/registry.d
@@ -890,11 +890,11 @@ public:
Returns the named sub-key of this key.
Params:
- name = The name of the subkey to create. May not be $(D null).
+ name = The name of the subkey to create. May not be `null`.
Returns:
The created key.
Throws:
- $(D RegistryException) is thrown if the key cannot be created.
+ `RegistryException` is thrown if the key cannot be created.
*/
Key createKey(string name, REGSAM access = REGSAM.KEY_ALL_ACCESS)
{
@@ -930,12 +930,12 @@ public:
Params:
name = The name of the subkey to aquire. If name is the empty
string, then the called key is duplicated.
- access = The desired access; one of the $(D REGSAM) enumeration.
+ access = The desired access; one of the `REGSAM` enumeration.
Returns:
The aquired key.
Throws:
- This function never returns $(D null). If a key corresponding to
- the requested name is not found, $(D RegistryException) is thrown.
+ This function never returns `null`. If a key corresponding to
+ the requested name is not found, `RegistryException` is thrown.
*/
Key getKey(string name, REGSAM access = REGSAM.KEY_READ)
{
@@ -969,7 +969,7 @@ public:
Deletes the named key.
Params:
- name = The name of the key to delete. May not be $(D null).
+ name = The name of the key to delete. May not be `null`.
*/
void deleteKey(string name, REGSAM access = cast(REGSAM)0)
{
@@ -980,11 +980,11 @@ public:
/**
Returns the named value.
- If $(D name) is the empty string, then the default value is returned.
+ If `name` is the empty string, then the default value is returned.
Returns:
- This function never returns $(D null). If a value corresponding
- to the requested name is not found, $(D RegistryException) is thrown.
+ This function never returns `null`. If a value corresponding
+ to the requested name is not found, `RegistryException` is thrown.
*/
Value getValue(string name)
{
@@ -1000,7 +1000,7 @@ public:
value = The 32-bit unsigned value to set.
Throws:
If a value corresponding to the requested name is not found,
- $(D RegistryException) is thrown.
+ `RegistryException` is thrown.
*/
void setValue(string name, uint value)
{
@@ -1015,10 +1015,10 @@ public:
name = The name of the value to set. If it is the empty string,
sets the default value.
value = The 32-bit unsigned value to set.
- endian = Can be $(D Endian.BigEndian) or $(D Endian.LittleEndian).
+ endian = Can be `Endian.BigEndian` or `Endian.LittleEndian`.
Throws:
If a value corresponding to the requested name is not found,
- $(D RegistryException) is thrown.
+ `RegistryException` is thrown.
*/
void setValue(string name, uint value, Endian endian)
{
@@ -1039,7 +1039,7 @@ public:
value = The 64-bit unsigned value to set.
Throws:
If a value corresponding to the requested name is not found,
- $(D RegistryException) is thrown.
+ `RegistryException` is thrown.
*/
void setValue(string name, ulong value)
{
@@ -1055,7 +1055,7 @@ public:
value = The string value to set.
Throws:
If a value corresponding to the requested name is not found,
- $(D RegistryException) is thrown.
+ `RegistryException` is thrown.
*/
void setValue(string name, string value)
{
@@ -1069,11 +1069,11 @@ public:
name = The name of the value to set. If it is the empty string,
sets the default value.
value = The string value to set.
- asEXPAND_SZ = If $(D true), the value will be stored as an
+ asEXPAND_SZ = If `true`, the value will be stored as an
expandable environment string, otherwise as a normal string.
Throws:
If a value corresponding to the requested name is not found,
- $(D RegistryException) is thrown.
+ `RegistryException` is thrown.
*/
void setValue(string name, string value, bool asEXPAND_SZ)
{
@@ -1096,7 +1096,7 @@ public:
value = The multiple-strings value to set.
Throws:
If a value corresponding to the requested name is not found,
- $(D RegistryException) is thrown.
+ `RegistryException` is thrown.
*/
void setValue(string name, string[] value)
{
@@ -1120,7 +1120,7 @@ public:
value = The binary value to set.
Throws:
If a value corresponding to the requested name is not found,
- $(D RegistryException) is thrown.
+ `RegistryException` is thrown.
*/
void setValue(string name, byte[] value)
{
@@ -1131,10 +1131,10 @@ public:
Deletes the named value.
Params:
- name = The name of the value to delete. May not be $(D null).
+ name = The name of the value to delete. May not be `null`.
Throws:
If a value of the requested name is not found,
- $(D RegistryException) is thrown.
+ `RegistryException` is thrown.
*/
void deleteValue(string name)
{
@@ -1206,7 +1206,7 @@ public:
Returns:
The contents of the value.
Throws:
- $(D RegistryException) if the type of the value is not REG_SZ,
+ `RegistryException` if the type of the value is not REG_SZ,
REG_EXPAND_SZ, REG_DWORD, or REG_QWORD.
*/
@property string value_SZ() const
@@ -1249,7 +1249,7 @@ public:
Returns:
The contents of the value.
Throws:
- $(D RegistryException) if the type of the value is not REG_MULTI_SZ.
+ `RegistryException` if the type of the value is not REG_MULTI_SZ.
*/
@property string[] value_MULTI_SZ() const
{
@@ -1267,7 +1267,7 @@ public:
Returns:
The contents of the value.
Throws:
- $(D RegistryException) is thrown for all types other than
+ `RegistryException` is thrown for all types other than
REG_DWORD, REG_DWORD_LITTLE_ENDIAN and REG_DWORD_BIG_ENDIAN.
*/
@property uint value_DWORD() const
@@ -1286,7 +1286,7 @@ public:
Returns:
The contents of the value.
Throws:
- $(D RegistryException) if the type of the value is not REG_QWORD.
+ `RegistryException` if the type of the value is not REG_QWORD.
*/
@property ulong value_QWORD() const
{
@@ -1309,7 +1309,7 @@ public:
Returns:
The contents of the value.
Throws:
- $(D RegistryException) if the type of the value is not REG_BINARY.
+ `RegistryException` if the type of the value is not REG_BINARY.
*/
@property byte[] value_BINARY() const
{
@@ -1415,7 +1415,7 @@ public:
Returns:
The name of the key corresponding to the given index.
Throws:
- $(D RegistryException) if no corresponding key is retrieved.
+ `RegistryException` if no corresponding key is retrieved.
*/
string opIndex(size_t index)
{
@@ -1492,7 +1492,7 @@ public:
Returns:
The key corresponding to the given index.
Throws:
- $(D RegistryException) if no corresponding key is retrieved.
+ `RegistryException` if no corresponding key is retrieved.
*/
Key getKey(size_t index)
{
@@ -1512,7 +1512,7 @@ public:
Returns:
The key corresponding to the given index.
Throws:
- $(D RegistryException) if no corresponding key is retrieved.
+ `RegistryException` if no corresponding key is retrieved.
*/
Key opIndex(size_t index)
{
@@ -1601,7 +1601,7 @@ public:
Returns:
The name of the value corresponding to the given index.
Throws:
- $(D RegistryException) if no corresponding value is retrieved.
+ `RegistryException` if no corresponding value is retrieved.
*/
string getValueName(size_t index)
{
@@ -1621,7 +1621,7 @@ public:
Returns:
The name of the value corresponding to the given index.
Throws:
- $(D RegistryException) if no corresponding value is retrieved.
+ `RegistryException` if no corresponding value is retrieved.
*/
string opIndex(size_t index)
{
@@ -1688,14 +1688,14 @@ public:
}
/**
- The value at the given $(D index).
+ The value at the given `index`.
Params:
index = The 0-based index of the value to retrieve
Returns:
The value corresponding to the given index.
Throws:
- $(D RegistryException) if no corresponding value is retrieved
+ `RegistryException` if no corresponding value is retrieved
*/
Value getValue(size_t index)
{
@@ -1708,14 +1708,14 @@ public:
}
/**
- The value at the given $(D index).
+ The value at the given `index`.
Params:
index = The 0-based index of the value to retrieve.
Returns:
The value corresponding to the given index.
Throws:
- $(D RegistryException) if no corresponding value is retrieved.
+ `RegistryException` if no corresponding value is retrieved.
*/
Value opIndex(size_t index)
{
diff --git a/std/windows/syserror.d b/std/windows/syserror.d
index 57229b45800..84aaf2ce46e 100644
--- a/std/windows/syserror.d
+++ b/std/windows/syserror.d
@@ -26,7 +26,7 @@ version (StdDdoc)
/// Query the text for a Windows error code (as returned by $(LINK2
/// http://msdn.microsoft.com/en-us/library/windows/desktop/ms679360.aspx,
- /// $(D GetLastError))) as a D string.
+ /// `GetLastError`)) as a D string.
string sysErrorString(
DWORD errCode,
// MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT) is the user's default language
@@ -36,20 +36,20 @@ version (StdDdoc)
/*********************
* Thrown if errors that set $(LINK2
* http://msdn.microsoft.com/en-us/library/windows/desktop/ms679360.aspx,
- * $(D GetLastError)) occur.
+ * `GetLastError`) occur.
*/
class WindowsException : Exception
{
private alias DWORD = int;
- final @property DWORD code(); /// $(D GetLastError)'s return value.
+ final @property DWORD code(); /// `GetLastError`'s return value.
@disable this(int dummy);
}
/++
- If $(D !!value) is true, $(D value) is returned. Otherwise,
+ If `!!value` is true, `value` is returned. Otherwise,
$(D new WindowsException(GetLastError(), msg)) is thrown.
- $(D WindowsException) assumes that the last operation set
- $(D GetLastError()) appropriately.
+ `WindowsException` assumes that the last operation set
+ `GetLastError()` appropriately.
Example:
--------------------
@@ -118,7 +118,7 @@ class WindowsException : Exception
{
import core.sys.windows.windows;
- final @property DWORD code() { return _code; } /// $(D GetLastError)'s return value.
+ final @property DWORD code() { return _code; } /// `GetLastError`'s return value.
private DWORD _code;
this(DWORD code, string str=null, string file = null, size_t line = 0) @trusted