You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2016/12/08 02:44:39 UTC
[3/6] mesos git commit: Remove use of `typename` causing Windows
build break.
Remove use of `typename` causing Windows build break.
The use of `typename` in C++ is used to disambiguate between static
members and dependent names that use the same symbol. For example, if
you have some `T::iterator` and `T` happens to have a static member
called iterator, it is necessary to add `typename T::iterator` to
indicate that you want an iterator of `T` rather than to refer to teh
static member `T::iterator`.
In some cases we employ `typename` to make our intention clearer, even
though it is not strictly speaking necessary. While normally a good
habit, in the specific cases we change in this review, it causes MSVC to
explode.
This commit will remove these uses.
Review: https://reviews.apache.org/r/53552/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/96e39e04
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/96e39e04
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/96e39e04
Branch: refs/heads/master
Commit: 96e39e04e9618272b8562e2475ce2a46cd770987
Parents: 0701fa5
Author: Alex Clemmer <cl...@gmail.com>
Authored: Wed Dec 7 11:07:14 2016 -0800
Committer: Joseph Wu <jo...@apache.org>
Committed: Wed Dec 7 18:44:17 2016 -0800
----------------------------------------------------------------------
src/master/allocator/mesos/hierarchical.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/96e39e04/src/master/allocator/mesos/hierarchical.cpp
----------------------------------------------------------------------
diff --git a/src/master/allocator/mesos/hierarchical.cpp b/src/master/allocator/mesos/hierarchical.cpp
index 33db3b8..a8cbc8d 100644
--- a/src/master/allocator/mesos/hierarchical.cpp
+++ b/src/master/allocator/mesos/hierarchical.cpp
@@ -466,7 +466,7 @@ void HierarchicalAllocatorProcess::addSlave(
// leverage state and features such as the FrameworkSorter and OfferFilter.
if (unavailability.isSome()) {
slaves[slaveId].maintenance =
- typename Slave::Maintenance(unavailability.get());
+ Slave::Maintenance(unavailability.get());
}
// If we have just a number of recovered agents, we cannot distinguish
@@ -857,7 +857,7 @@ void HierarchicalAllocatorProcess::updateUnavailability(
// If we have a new unavailability.
if (unavailability.isSome()) {
slaves[slaveId].maintenance =
- typename Slave::Maintenance(unavailability.get());
+ Slave::Maintenance(unavailability.get());
}
allocate(slaveId);
@@ -881,7 +881,7 @@ void HierarchicalAllocatorProcess::updateInverseOffer(
// We use a reference by alias because we intend to modify the
// `maintenance` and to improve readability.
- typename Slave::Maintenance& maintenance = slaves[slaveId].maintenance.get();
+ Slave::Maintenance& maintenance = slaves[slaveId].maintenance.get();
// Only handle inverse offers that we currently have outstanding. If it is not
// currently outstanding this means it is old and can be safely ignored.
@@ -1732,7 +1732,7 @@ void HierarchicalAllocatorProcess::deallocate(
if (slaves[slaveId].maintenance.isSome()) {
// We use a reference by alias because we intend to modify the
// `maintenance` and to improve readability.
- typename Slave::Maintenance& maintenance =
+ Slave::Maintenance& maintenance =
slaves[slaveId].maintenance.get();
hashmap<string, Resources> allocation =