www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4783] New: atomicOp!"^^" doesn't work b/c it doesn't have access to std.math

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4783

           Summary: atomicOp!"^^" doesn't work b/c it doesn't have access
                    to std.math
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: sean invisibleduck.org
        ReportedBy: dsimcha yahoo.com



import core.atomic;

void main() {
    int num1 = 1;
    int num2 = 1;
    int res = atomicOp!"^^"(num1, num2);
}


Errors:

d:\dmd2\windows\bin\..\..\src\druntime\import\core\atomic.di(96): Error: must
import std.math to use ^^ operator
d:\dmd2\windows\bin\..\..\src\druntime\import\core\atomic.di(6): Error:
template instance core.atomic.atomicOp!("^^",int,int) error instantiating

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 01 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4783


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug yahoo.com.au



That's correct. You need to import std.math if you want to use ^^.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 01 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4783





 That's correct. You need to import std.math if you want to use ^^.
Oh sorry. Misunderstood. Yes, ^^ should not be used anywhere in core.* -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 01 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4783




Then if ^^ isn't going to be usable w/o importing std.math anytime soon, I
guess we need to get rid of it from core.atomic.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 01 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4783




...or, since the whole thing is based on doing the operation and CASing back
the result, we could make a version of atomicOp that takes an arbitrary lambda
expression.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 01 2010
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4783





 Then if ^^ isn't going to be usable w/o importing std.math anytime soon, I
 guess we need to get rid of it from core.atomic.
Yes. Something so high level has no business being in core. pow() for floating point exponents is a *huge* function. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 01 2010