Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VectorOperations should use 'ref' #4

Closed
GoogleCodeExporter opened this issue Mar 16, 2015 · 3 comments
Closed

VectorOperations should use 'ref' #4

GoogleCodeExporter opened this issue Mar 16, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

As a struct might implement the IVector interface it is necessary to flag all 
by reference parameters with the ref keyword. See 
Accelerators.VectorOperations for example.


Original issue reported on code.google.com by christop...@gmail.com on 21 Jun 2009 at 6:04

@GoogleCodeExporter
Copy link
Author

siwtched milestone number

Original comment by christop...@gmail.com on 21 Jun 2009 at 1:05

  • Added labels: Milestone-Release9.8
  • Removed labels: Milestone-Release1.0

@GoogleCodeExporter
Copy link
Author

Adding an issue-test to verify issue.
Currently, if a struct is used that encapsulates the coordinates as a reference 
type 
(i.e as an System.Array or Collection type) then everything works as expected. 
The 
struct is copied by value, but coordinates are copied by reference. 

On the other side, when value types are explicitely used to store the 
coordinates 
VectorOperations methods fail.

Original comment by christop...@gmail.com on 22 Jun 2009 at 6:05

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

modified signatures of methods modifying IVectors to 

Sub<T>(IVector a, IVector b, ref T dest) where T : IVector {}.

It seems to be inconvinient/impossible to have a signature such as 

Sub(IVector a, IVector b, ref IVector dest)

since the ref argument need to be cast to IVector such as

Sub(a, b, ref (IVector)dest) which is not possible.

resolved in revision #148.

Original comment by christop...@gmail.com on 22 Jun 2009 at 7:01

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant