proxygen
test_functions.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2011-present Facebook, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
18 
19 #include <folly/lang/Exception.h>
20 
21 /*
22  * These functions are defined in a separate file so that
23  * gcc won't be able to inline them.
24  */
25 
26 void doNothing() {}
27 
28 std::exception_ptr returnExceptionPtr() {
29  Exception ex("this is a test");
30  return std::make_exception_ptr(ex);
31 }
32 
33 void exceptionPtrReturnParam(std::exception_ptr* excReturn) {
34  if (excReturn) {
35  Exception ex("this is a test");
36  *excReturn = std::make_exception_ptr(ex);
37  }
38 }
39 
41  return "this is a test";
42 }
43 
45  return "this is a test";
46 }
47 
48 int returnCode(int value) {
49  return value;
50 }
51 
53  return value;
54 }
55 
57 
59 
61 
63  // Suppress unused field warning
64  data[0] = 42;
65 }
66 
67 void LargeClass::operator()() const {}
68 
69 void invoke(std::function<void()> f) {
70  f();
71 }
72 
73 void invoke(folly::Function<void()> f) {
74  f();
75 }
void invoke(std::function< void()> f)
int returnCode(int value)
auto f
std::string returnStringNoExcept() noexcept
requires E e noexcept(noexcept(s.error(std::move(e))))
virtual ~VirtualClass()
void operator()() const
std::exception_ptr returnExceptionPtr()
virtual void doNothing()
void doNothing()
void exceptionPtrReturnParam(std::exception_ptr *excReturn)
void doNothing()
static const char *const value
Definition: Conv.cpp:50
std::string returnString()
const char * string
Definition: Conv.cpp:212
int returnCodeNoExcept(int value) noexcept
static constexpr uint64_t data[1]
Definition: Fingerprint.cpp:43