mirror of
https://github.com/RGBCube/serenity
synced 2025-05-18 13:45:08 +00:00

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.
24 lines
346 B
C++
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&);
|
|
|
|
}
|