digitalmars.D.learn - toString conflic importing std.string & std.date?
- AEon (10/10) Mar 25 2005 I am presently trying to use th std.date functions to get the current
- J C Calvarese (13/29) Mar 25 2005 Sure. There are a few ways to approach it. You can alias one of the
- AEon (8/36) Mar 26 2005 Ah... that works wonderfully, I normally assume the toString to indeed
- Regan Heath (4/23) Mar 27 2005 Isn't the real solution to change the std.date alias for d_time into a
I am presently trying to use th std.date functions to get the current system time, but when I add this code import std.string; import std.date; I get a conflict: E:\d\dmd\bin\..\src\phobos\std\string.d(2009): function std.string.toString conf licts with std.date.toString at E:\d\dmd\bin\..\src\phobos\std\date.d(410) --- errorlevel 1 Any way to fix this?
Mar 25 2005
AEon wrote:I am presently trying to use th std.date functions to get the current system time, but when I add this code import std.string; import std.date; I get a conflict: E:\d\dmd\bin\..\src\phobos\std\string.d(2009): function std.string.toString conf licts with std.date.toString at E:\d\dmd\bin\..\src\phobos\std\date.d(410) --- errorlevel 1 Any way to fix this?Sure. There are a few ways to approach it. You can alias one of the toString's to make it default like this... import std.string; import std.date; alias std.string.toString toString; Or you can type out std.string.toString or std.date.toString each time you refer to toString to disambiguate it. Here's a brief description of a similar error: http://www.prowiki.org/wiki4d/wiki.cgi?ErrorMessages#ConflictingSymbols -- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/
Mar 25 2005
J C Calvarese wrote:AEon wrote:Ah... that works wonderfully, I normally assume the toString to indeed be the std.string one. So the above is the best way to go for me.I am presently trying to use th std.date functions to get the current system time, but when I add this code import std.string; import std.date; I get a conflict: E:\d\dmd\bin\..\src\phobos\std\string.d(2009): function std.string.toString conf licts with std.date.toString at E:\d\dmd\bin\..\src\phobos\std\date.d(410) --- errorlevel 1 Any way to fix this?Sure. There are a few ways to approach it. You can alias one of the toString's to make it default like this... import std.string; import std.date; alias std.string.toString toString;Or you can type out std.string.toString or std.date.toString each time you refer to toString to disambiguate it.I did that only for the std.date.toString, and had thought that would make things clear, but come to think of it the default would then still not have been properly defined. Thanx. AEon
Mar 26 2005
On Fri, 25 Mar 2005 23:04:16 -0600, J C Calvarese <jcc7 cox.net> wrote:AEon wrote:Isn't the real solution to change the std.date alias for d_time into a typedef? ReganI am presently trying to use th std.date functions to get the current system time, but when I add this code import std.string; import std.date; I get a conflict: E:\d\dmd\bin\..\src\phobos\std\string.d(2009): function std.string.toString conf licts with std.date.toString at E:\d\dmd\bin\..\src\phobos\std\date.d(410) --- errorlevel 1 Any way to fix this?Sure. There are a few ways to approach it. You can alias one of the toString's to make it default like this... import std.string; import std.date; alias std.string.toString toString; Or you can type out std.string.toString or std.date.toString each time you refer to toString to disambiguate it. Here's a brief description of a similar error: http://www.prowiki.org/wiki4d/wiki.cgi?ErrorMessages#ConflictingSymbols
Mar 27 2005