1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 13:45:08 +00:00
serenity/Userland/Libraries/LibIPC/Forward.h
Timothy Flynn b1ea418d14 LibIPC: Forward declare the encode() and decode() template functions
For the most part, we try to provide specializations of these functions
in various headers by including "LibIPC/Forward.h" and then declaring
encode() and decode() specializations. However, without any forward
declaration of these types, we aren't actually specializing anything.
Rather, we are just declaring overloads, which trips up the base encode
and decode template definitions.

The result is that LibIPC is very sensitive to include order, and the
DependentFalse<> static assertion would fail if the includes weren't
perfectly ordered.

By properly forward declaring these templates, we can make sure the
specializations receive precedence over the base templates.
2022-11-15 13:25:51 -05:00

24 lines
346 B
C++

/*
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
namespace IPC {
class Decoder;
class Dictionary;
class Encoder;
class Message;
class File;
class Stub;
template<typename T>
bool encode(Encoder&, T const&);
template<typename T>
ErrorOr<void> decode(Decoder&, T&);
}