473,394 Members | 1,845 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

C++20: Technical Question on upcoming Modules

1
Suppose a module M has an exported method foo whose implementation uses class myclass and/or method mymethod that originiate in an unrelated module or header and the module doesn't export them . Also implemetation of this method foo is exported in the module M.https://speedtest.vet/

Can one import the module and use the function foo from another library doesn't import of either myclass or mymethod? Technically, one can use implementation that supplied by the module so it can work.

Why the question? Suppose I have a simple function foo that can be inlined (fully or not fully as it might call some other heavy methods but it will at least save unnecessary function call). However, to compile and inline it one needs to import an additional header or module and I want to minimize header-level dependencies.

So the question is in short, is it possible to use exported method whose implementation is also exported - yet my current module is unable to compile it due to dependencies issue? Or the implementation must not be exported in this case?

Edit: from the replies it is understood the classification of "visible" and "reachable" methods/classes essentialy solve the issue. However, now I have another question: When ODR violation happens? When visible objects have identical names or even when reachable objects have the same name?

In similar note, consider diamond problem in modules. struct X is used by module A and module B yet none of them export it. Can module B use struct X generated by A? If yes, then suppose struct X is defined differently in A and B will it result in UB or a sensible compiler/linker error?
Apr 9 '20 #1
0 1468

Sign in to post your reply or Sign up for a free account.

Similar topics

36
by: Tim Churches | last post by:
If a compiled Python extension module B includes code from some other software A which is licensed only under the GPL, do other Python programmes, C, which import module B also need to be licensed...
68
by: Grant Edwards | last post by:
Let's say I use a GPL'd python module (e.g. something installed in site-packages) in an application. Let's also say I use py2exe to package and distribute said application. Is what I'm...
2
by: James Buchanan | last post by:
Hi group, I'm preparing Python 2.4.2 for the upcoming Minix 3.x release, and I have problems with make. configure runs fine and creates the makefile, but right at the end ends with an error...
1
by: Jordan Bruce | last post by:
******************************************************* ONTARIO CANADA INFORMIX USER GROUP (OCIUG) http://www.iiug.org/ociug NEXT MEETING: WEDNESDAY, JULY 14...
0
by: Nick White [MSFT] | last post by:
Hello fellow Microsoft Windows Mobile and Embedded enthusiasts: I invite you to peruse the list below of upcoming technical chats and Webcasts offered by the Windows Mobile and Embedded Devices...
12
by: Morten Snedker | last post by:
I've read that modules in .Net are mainly for backwards compability. Is this true? If I have variables I want to be exposed to all classes (regular classes, forms etc), I'd find it natural to...
11
by: fortepianissimo | last post by:
Say I have the following package organization in a system I'm developing: A |----B |----C |----D I have a module, say 'foo', that both package D and B require. What is the best practice in...
5
by: Aziz | last post by:
Hi, I've recently contacted technical service of a web hosting company and asked them wheter or not they're gonna upgrade to PHP5 and MySQL5. Here's a quote from their response which confused me...
4
by: wanwan | last post by:
Hi, I have a project with multiple c files. Some of these modules have functions that have the same name and their operations are exactly the same. My rusty memory tells me there is a way...
173
by: Zytan | last post by:
I've read the docs on this, but one thing was left unclear. It seems as though a Module does not have to be fully qualified. Is this the case? I have source that apparently shows this. Are...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.