mirror of
https://github.com/MaskRay/ccls.git
synced 2025-01-31 09:50:26 +00:00
Add using declaration to optional.h, include STL optional if available or fallback to third-party one.
This commit is contained in:
parent
b6071004df
commit
48f3c75053
@ -1,12 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <optional.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
using std::experimental::nullopt;
|
||||
using std::experimental::optional;
|
||||
|
||||
struct Config;
|
||||
struct IndexFile;
|
||||
|
||||
|
@ -1,14 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <optional.h>
|
||||
|
||||
#include <clang-c/Index.h>
|
||||
#include <optional.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
using std::experimental::optional;
|
||||
|
||||
class ClangType {
|
||||
public:
|
||||
ClangType();
|
||||
|
@ -3,8 +3,8 @@
|
||||
#include "language_server_api.h"
|
||||
|
||||
#include <clang-c/Index.h>
|
||||
|
||||
#include <optional.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
using namespace std::experimental;
|
||||
|
@ -6,9 +6,6 @@
|
||||
|
||||
#include <mutex>
|
||||
|
||||
using namespace std::experimental;
|
||||
using std::experimental::nullopt;
|
||||
|
||||
// Cached completion information, so we can give fast completion results when
|
||||
// the user erases a character. vscode will resend the completion request if
|
||||
// that happens.
|
||||
|
@ -5,9 +5,9 @@
|
||||
#include "serializer.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "optional.h"
|
||||
#include "variant.h"
|
||||
#include <optional.h>
|
||||
#include <rapidjson/writer.h>
|
||||
#include <variant.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
@ -15,9 +15,6 @@
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
|
||||
using std::experimental::nullopt;
|
||||
using std::experimental::optional;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -6,9 +6,6 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
using std::experimental::nullopt;
|
||||
using std::experimental::optional;
|
||||
|
||||
struct Matcher {
|
||||
static optional<Matcher> Create(const std::string& search);
|
||||
|
||||
|
@ -6,9 +6,6 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
using std::experimental::nullopt;
|
||||
using std::experimental::optional;
|
||||
|
||||
struct PlatformMutex {
|
||||
virtual ~PlatformMutex();
|
||||
};
|
||||
|
@ -10,9 +10,6 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
using std::experimental::nullopt;
|
||||
using std::experimental::optional;
|
||||
|
||||
struct Project {
|
||||
struct Entry {
|
||||
std::string filename;
|
||||
|
@ -3,12 +3,11 @@
|
||||
#include "lru_cache.h"
|
||||
#include "query.h"
|
||||
|
||||
#include <optional.h>
|
||||
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
using std::experimental::nullopt;
|
||||
using std::experimental::optional;
|
||||
|
||||
// Caches symbols for a single file for semantic highlighting to provide
|
||||
// relatively stable ids. Only supports xxx files at a time.
|
||||
struct SemanticHighlightSymbolCache {
|
||||
|
@ -1,18 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <macro_map.h>
|
||||
#include <optional.h>
|
||||
#include <variant.h>
|
||||
#include <rapidjson/document.h>
|
||||
#include <rapidjson/prettywriter.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "macro_map.h"
|
||||
#include "optional.h"
|
||||
#include "variant.h"
|
||||
#include "rapidjson/document.h"
|
||||
#include "rapidjson/prettywriter.h"
|
||||
|
||||
using std::experimental::nullopt;
|
||||
using std::experimental::optional;
|
||||
|
||||
using Reader = rapidjson::GenericValue<rapidjson::UTF8<>>;
|
||||
using Writer = rapidjson::Writer<rapidjson::StringBuffer>;
|
||||
struct IndexFile;
|
||||
|
@ -9,9 +9,6 @@
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
using std::experimental::optional;
|
||||
using std::experimental::nullopt;
|
||||
|
||||
enum class TaskThread {
|
||||
Indexer,
|
||||
QueryDb,
|
||||
|
@ -11,9 +11,6 @@
|
||||
#include <mutex>
|
||||
#include <queue>
|
||||
|
||||
using std::experimental::nullopt;
|
||||
using std::experimental::optional;
|
||||
|
||||
// TODO: cleanup includes.
|
||||
|
||||
struct BaseThreadQueue {
|
||||
|
@ -5,9 +5,6 @@
|
||||
#include <chrono>
|
||||
#include <string>
|
||||
|
||||
using std::experimental::nullopt;
|
||||
using std::experimental::optional;
|
||||
|
||||
struct Timer {
|
||||
using Clock = std::chrono::high_resolution_clock;
|
||||
|
||||
|
@ -7,9 +7,6 @@
|
||||
#include <mutex>
|
||||
#include <unordered_map>
|
||||
|
||||
using namespace std::experimental;
|
||||
using std::experimental::nullopt;
|
||||
|
||||
// Caches timestamps of cc files so we can avoid a filesystem reads. This is
|
||||
// important for import perf, as during dependency checking the same files are
|
||||
// checked over and over again if they are common headers.
|
||||
|
@ -10,9 +10,6 @@
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
using std::experimental::nullopt;
|
||||
using std::experimental::optional;
|
||||
|
||||
// Trim from start (in place)
|
||||
void TrimStartInPlace(std::string& s);
|
||||
// Trim from end (in place)
|
||||
|
@ -9,9 +9,6 @@
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
|
||||
using std::experimental::nullopt;
|
||||
using std::experimental::optional;
|
||||
|
||||
struct WorkingFile {
|
||||
int version = 0;
|
||||
std::string filename;
|
||||
|
Loading…
Reference in New Issue
Block a user