Skip to content

Commit

Permalink
removed elaborated friend declarations
Browse files Browse the repository at this point in the history
Used forward declarations declared before instead.

It looks like the elaborated friend declarations will be dropped
from the C++26.
  • Loading branch information
silverqx committed Jul 28, 2024
1 parent 08f679f commit e833caa
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion drivers/common/include/orm/drivers/sqldatabase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace Orm::Drivers
// To access the private constructors and d smart pointer (private impl.)
friend SqlDatabaseManager;
// To access the d smart pointer (private implementation)
friend class SqlDatabasePrivate;
friend SqlDatabasePrivate;

/*! Alias for the NotNull. */
template<typename T>
Expand Down
3 changes: 2 additions & 1 deletion drivers/common/include/orm/drivers/sqldriver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ namespace Orm::Drivers
{

class DummySqlError;
class SqlDatabase;
class SqlDriverPrivate;
class SqlRecord;
class SqlResult;
Expand All @@ -29,7 +30,7 @@ namespace Orm::Drivers
Q_DECLARE_PRIVATE(SqlDriver) // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)

// To access the setConnectionName()
friend class SqlDatabase;
friend SqlDatabase;

protected:
/*! Protected constructor. */
Expand Down
3 changes: 2 additions & 1 deletion drivers/common/include/orm/drivers/sqlresult.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ namespace Orm::Drivers
{

class SqlDriver;
class SqlQuery;
class SqlRecord;
class SqlResultPrivate;

Expand All @@ -28,7 +29,7 @@ namespace Orm::Drivers
Q_DECLARE_PRIVATE(SqlResult) // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)

// To access practically everything, all logic is defined in the SqlResult
friend class SqlQuery;
friend SqlQuery;

protected:
/*! Constructor. */
Expand Down
3 changes: 2 additions & 1 deletion drivers/mysql/include/orm/drivers/mysql/mysqldriver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace Orm::Drivers::MySql
{

class MySqlDriverPrivate;
class MySqlResultPrivate;

/*! MySQL database driver. */
class TINYDRIVERS_EXPORT MySqlDriver final :
Expand All @@ -25,7 +26,7 @@ namespace Orm::Drivers::MySql
/* To access MySqlDriver::d_func() through the MySqlResultPrivate::drv_d_func(),
what means that the MySqlResultPrivate will have access
to the MySqlDriverPrivate. */
friend class MySqlResultPrivate;
friend MySqlResultPrivate;

public:
/*! Default constructor. */
Expand Down
4 changes: 3 additions & 1 deletion include/orm/concerns/countsqueries.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ class DatabaseConnection;
namespace Concerns
{

class ManagesTransactions;

/*! Counts the number of executed queries and the elapsed time of queries. */
class TINYORM_EXPORT CountsQueries
{
Q_DISABLE_COPY_MOVE(CountsQueries)

// To access hitTransactionalCounters() method
friend class ManagesTransactions;
friend ManagesTransactions;

public:
/*! Default constructor. */
Expand Down
2 changes: 1 addition & 1 deletion include/orm/configurations/configurationparser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace Orm::Configurations
Q_DISABLE_COPY_MOVE(ConfigurationParser)

// To access config()
friend class ConfigurationOptionsParser;
friend ConfigurationOptionsParser;

public:
/*! Default constructor. */
Expand Down
2 changes: 1 addition & 1 deletion include/orm/databaseconnection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace Orm
https://community.kde.org/Policies/Binary_Compatibility_Issues_With_C++ */
#ifdef TINYORM_MYSQL_PING
// To access logConnected()/logDisconnected() methods
friend class MySqlConnection;
friend MySqlConnection;
#endif

/*! Alias for the QueryError exception. */
Expand Down

0 comments on commit e833caa

Please sign in to comment.