From 0271cd35577599fa99b59202da17d3136956e4c0 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Wed, 3 Jan 2018 09:52:58 -0800 Subject: Changes imported from Abseil "staging" branch: - 6e88015f26885b66ce9b11696eb9c8d96ef7c0f6 Add ABSL_MUST_USE_RESULT to absl::StripPrefix and absl::S... by Mark Barolak - 47d8de97748da346ad2a962f27389e0380a7a716 Fix missing header include when compiling with _GLIBCXX_D... by Alex Strelnikov GitOrigin-RevId: 6e88015f26885b66ce9b11696eb9c8d96ef7c0f6 Change-Id: I8698c77d9eab81455b209a6bef4bb2d5b32ebd65 --- absl/strings/BUILD.bazel | 1 + absl/strings/CMakeLists.txt | 1 + absl/strings/internal/stl_type_traits.h | 213 +++++++++++++++++++++++++++++ absl/strings/internal/str_split_internal.h | 24 ++-- absl/strings/str_split_test.cc | 12 ++ absl/strings/strip.h | 8 +- 6 files changed, 241 insertions(+), 18 deletions(-) create mode 100644 absl/strings/internal/stl_type_traits.h (limited to 'absl/strings') diff --git a/absl/strings/BUILD.bazel b/absl/strings/BUILD.bazel index f6272586419b..13badb7b9c25 100644 --- a/absl/strings/BUILD.bazel +++ b/absl/strings/BUILD.bazel @@ -39,6 +39,7 @@ cc_library( "escaping.cc", "internal/memutil.cc", "internal/memutil.h", + "internal/stl_type_traits.h", "internal/str_join_internal.h", "internal/str_split_internal.h", "match.cc", diff --git a/absl/strings/CMakeLists.txt b/absl/strings/CMakeLists.txt index f75b55a959ac..83cb934dba9d 100644 --- a/absl/strings/CMakeLists.txt +++ b/absl/strings/CMakeLists.txt @@ -35,6 +35,7 @@ list(APPEND STRINGS_INTERNAL_HEADERS "internal/memutil.h" "internal/ostringstream.h" "internal/resize_uninitialized.h" + "internal/stl_type_traits.h" "internal/str_join_internal.h" "internal/str_split_internal.h" "internal/utf8.h" diff --git a/absl/strings/internal/stl_type_traits.h b/absl/strings/internal/stl_type_traits.h new file mode 100644 index 000000000000..8c3d877e6356 --- /dev/null +++ b/absl/strings/internal/stl_type_traits.h @@ -0,0 +1,213 @@ +// Copyright 2017 The Abseil Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Thie file provides the IsStrictlyBaseOfAndConvertibleToSTLContainer type +// trait metafunction to assist in working with the _GLIBCXX_DEBUG debug +// wrappers of STL containers. +// +// DO NOT INCLUDE THIS FILE DIRECTLY. Use this file by including +// absl/strings/str_split.h. +// +// IWYU pragma: private, include "absl/strings/str_split.h" + +#ifndef ABSL_STRINGS_INTERNAL_STL_TYPE_TRAITS_H_ +#define ABSL_STRINGS_INTERNAL_STL_TYPE_TRAITS_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "absl/meta/type_traits.h" + +namespace absl { +namespace strings_internal { + +template class T> +struct IsSpecializationImpl : std::false_type {}; +template