mirror of
https://github.com/vczh-libraries/Release.git
synced 2026-05-31 05:35:18 +08:00
Update import
This commit is contained in:
+25
-14
@@ -367,6 +367,10 @@ namespace vl
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// G++ workaround
|
||||||
|
template<typename K, typename V, size_t Index>
|
||||||
|
struct PairGet;
|
||||||
|
|
||||||
/// <summary>A type representing a pair of key and value.</summary>
|
/// <summary>A type representing a pair of key and value.</summary>
|
||||||
/// <typeparam name="K">Type of the key.</typeparam>
|
/// <typeparam name="K">Type of the key.</typeparam>
|
||||||
/// <typeparam name="V">Type of the value.</typeparam>
|
/// <typeparam name="V">Type of the value.</typeparam>
|
||||||
@@ -427,25 +431,32 @@ namespace vl
|
|||||||
return key == p.key && value == p.value;
|
return key == p.key && value == p.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////
|
template<size_t Index>
|
||||||
|
decltype(auto) get()
|
||||||
|
{
|
||||||
|
return PairGet<K, V, Index>::get(*this);
|
||||||
|
}
|
||||||
|
|
||||||
template<size_t Index>
|
template<size_t Index>
|
||||||
typename pair_internal::TypePairElementRetriver<Index, Pair<K, V>>::Type& get() = delete;
|
decltype(auto) get() const
|
||||||
|
{
|
||||||
|
return PairGet<K, V, Index>::get(*this);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
template<>
|
template<typename K, typename V>
|
||||||
typename pair_internal::TypePairElementRetriver<0, Pair<K, V>>::Type& get<0>() { return key; }
|
struct PairGet<K, V, 0>
|
||||||
|
{
|
||||||
|
static typename pair_internal::TypePairElementRetriver<0, Pair<K, V>>::Type& get(Pair<K, V>& p) { return p.key; }
|
||||||
|
static typename pair_internal::TypePairElementRetriver<0, const Pair<K, V>>::Type& get(const Pair<K, V>& p) { return p.key; }
|
||||||
|
};
|
||||||
|
|
||||||
template<>
|
|
||||||
typename pair_internal::TypePairElementRetriver<1, Pair<K, V>>::Type& get<1>() { return value; }
|
|
||||||
|
|
||||||
template<size_t Index>
|
template<typename K, typename V>
|
||||||
typename pair_internal::TypePairElementRetriver<Index, const Pair<K, V>>::Type& get() const = delete;
|
struct PairGet<K, V, 1>
|
||||||
|
{
|
||||||
template<>
|
static typename pair_internal::TypePairElementRetriver<1, Pair<K, V>>::Type& get(Pair<K, V>& p) { return p.value; }
|
||||||
typename pair_internal::TypePairElementRetriver<0, const Pair<K, V>>::Type& get<0>() const { return key; }
|
static typename pair_internal::TypePairElementRetriver<1, const Pair<K, V>>::Type& get(const Pair<K, V>& p) { return p.value; }
|
||||||
|
|
||||||
template<>
|
|
||||||
typename pair_internal::TypePairElementRetriver<1, const Pair<K, V>>::Type& get<1>() const { return value; }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename K, typename V>
|
template<typename K, typename V>
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ FilePath
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (fullPath.Length() == 0)
|
if (fullPath.Length() == 0)
|
||||||
fullPath = L"/";
|
fullPath = WString::Unmanaged(L"/");
|
||||||
|
|
||||||
if (fullPath[0] != Delimiter)
|
if (fullPath[0] != Delimiter)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -45,6 +45,11 @@ FilePath
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FilePath::FilePath()
|
||||||
|
{
|
||||||
|
Initialize();
|
||||||
|
}
|
||||||
|
|
||||||
FilePath::FilePath(const WString& _filePath)
|
FilePath::FilePath(const WString& _filePath)
|
||||||
:fullPath(_filePath)
|
:fullPath(_filePath)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -1907,7 +1907,7 @@ namespace vl
|
|||||||
|
|
||||||
/// <summary>Create a root path.</summary>
|
/// <summary>Create a root path.</summary>
|
||||||
/// <remarks><see cref="GetFullPath"/> returns different values for root path on different platforms. Do not rely on the value.</remarks>
|
/// <remarks><see cref="GetFullPath"/> returns different values for root path on different platforms. Do not rely on the value.</remarks>
|
||||||
FilePath() = default;
|
FilePath();
|
||||||
/// <summary>Create a file path.</summary>
|
/// <summary>Create a file path.</summary>
|
||||||
/// <param name="_filePath">Content of the file path. If it is a relative path, it will be converted to an absolute path.</param>
|
/// <param name="_filePath">Content of the file path. If it is a relative path, it will be converted to an absolute path.</param>
|
||||||
FilePath(const WString& _filePath);
|
FilePath(const WString& _filePath);
|
||||||
|
|||||||
Reference in New Issue
Block a user