DateTime: add default constructor (#1220)

This commit is contained in:
Anton Kolesnyk 2020-12-18 18:21:24 -08:00 committed by GitHub
parent e3d8719281
commit d40b4fb642
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View File

@ -5,9 +5,10 @@
### New Features
- Added a WinHTTP-based `HttpTransport` called `WinHttpTransport` and use that as the default `TransportPolicyOptions.Transport` on Windows when sending and receiving requests and responses over the wire.
- Added `Range` type to `Azure::Core::Http` namespace.
- Added `Range` type to `Azure::Core::Http` namespace.
- Added support for long-running operations with `Operation<T>`.
- Added support for setting a custom transport adapter by implementing the method `std::shared_ptr<HttpTransport> ::AzureSdkGetCustomHttpTransport()`.
- Added default constructor to `DateTime`.
### Breaking Changes

View File

@ -227,5 +227,11 @@ namespace Azure { namespace Core {
// Private constructor. Use static methods to create an instance.
explicit DateTime(Duration const& since1601) : m_since1601(since1601) {}
Duration m_since1601;
public:
/**
* @brief Construct an instance of @DateTime.
*/
DateTime() : m_since1601(0) {}
};
}} // namespace Azure::Core

View File

@ -578,3 +578,9 @@ TEST(DateTime, ArithmeticOperators)
dt3 = dt2 - 24h;
EXPECT_EQ(dt3, dt1);
}
TEST(DateTime, DefaultConstructible)
{
DateTime dt;
EXPECT_EQ(0, (dt - Year1601).count());
}