Skip to content

Commit

Permalink
Add ASF license header
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-webb committed Jul 22, 2024
1 parent d821f11 commit a5420f2
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/main/include/log4cxx/helpers/optional.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/

#ifndef LOG4CXX_OPTIONAL_HDR_
#define LOG4CXX_OPTIONAL_HDR_

#ifdef __has_include // Check if __has_include is present
# if __has_include(<optional>) // Check for a standard version
# include <optional>
# if defined(__cpp_lib_optional) // C++ >= 17
namespace LOG4CXX_NS { template< class T > using Optional = std::optional<T>; }
#define LOG4CXX_HAS_STD_OPTIONAL 1
#endif
# endif
# elif __has_include(<experimental/optional>) // Check for an experimental version
# include <experimental/optional>
namespace LOG4CXX_NS { template< class T > using Optional = std::experimental::optional<T>; }
Expand Down Expand Up @@ -38,3 +58,5 @@ class Optional : private std::pair<bool, T>
};
} // namespace LOG4CXX_NS
#endif

#endif // LOG4CXX_OPTIONAL_HDR_

0 comments on commit a5420f2

Please sign in to comment.