-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Runtimetenet-performancePerformance related issuePerformance related issue
Milestone
Description
Separated out of https://github.com/dotnet/corefx/issues/21281 for tracking purposes.
- Implement in System.Private.CoreLib in coreclr (corert shares the same files)
- Expose from System.Runtime contract in corefx
- Add tests to System.Runtime tests in corefx
namespace System
{
public class Version
{
public static Version Parse(ReadOnlySpan<char> input);
public static bool TryParse(ReadOnlySpan<char> input, out Version result);
public bool TryFormat(Span<char> destination, out int charsWritten, int fieldCount = 4);
…
}
}EDIT 8/17/2017:
We'd approved:
public bool TryFormat(Span<char> destination, out int charsWritten, int fieldCount = 4);as a way to avoid needing to add two TryFormat overloads based on whether it takes a fieldCount or not, but it turns out that deviates from the ToString()/ToString(fieldCount) behavior, where the former doesn't always use fieldCount == 4 but rather dynamically determines the value based on the instance, so we should add both:
public bool TryFormat(Span<char> destination, out int charsWritten);
public bool TryFormat(Span<char> destination, int fieldCount, out int charsWritten);Metadata
Metadata
Assignees
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Runtimetenet-performancePerformance related issuePerformance related issue